Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic S200B event support #784

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jcfarsight
Copy link

This change adds a very basic handler for detecting TriggerLogComponent events (from an S200B device in my case) and passing them through to hass.

@petretiandrea I'm not sure what your vision was with how these types of devices should be supported. I'm no expert at python or hass development but happy to adapt or drop this PR as needed.

@dhniceday
Copy link

Hello @petretiandrea
Is it possible to review this and if it works to push it to the repository? I think that a lot of people (me included) would highly appreciate. Would be great. Thanks in advance!

@easynote
Copy link

Not work yet? woul be nice to have the rotate and button functions.

@Edned0
Copy link

Edned0 commented Aug 15, 2024

Not work yet? woul be nice to have the rotate and button functions.

Not yet -- I emailed the repo owner a week ago but no response yet. Looking forward to having this integration as it would complete my HA setup!

@PanicPaintbrush
Copy link

image
Currently doesn't work.
If you revert the changes to const.py it does work. A little janky to set up automations but functional.

@markoavlis
Copy link

Hi to everyone,
I just bought HA Green and I'm facing the same issue that you described.
Did you know when they are going add the S200B functionalities?
Thank you

@ados8
Copy link

ados8 commented Nov 16, 2024

There's multiple overlapping posts regarding this but this seems like the best of them.
I spent too many hours finding some way to do this, once again vendors pump out products and don't want to support them.
TP-Link get your act together and support your products! Anyway, I found a way but it's super hacky.
Note this should work for any unsupported product for Tapo.
I've tested it many times and the response speed is just a few seconds.

Prerequisites:
Minimal but there's strict requirements, don't need the hub connected to HA but have it anyway.

  • Android mobile (I don't have an iPhone but highly doubt it will work due to Apple control)
  • Mobile app BuzzKill
  • HA for mobile
  • Tapo mobile app (aka cloud)

Again, this is a solid workaround but it is a workaround. Decide if it's for you.
How will it work? We use the Tapo app with automation to send a notification to your mobile.
This notification is read by HA mobile and updates on the server.
HA automation is triggered and the desired actions are performed.
BuzzKill is there to suppress the notification, one of its many powerful features.

Important, this is using Tapo for the notification which I assume is using their cloud although they arrive near instantly.
Can only assume if the internet or cloud is down this will break the flow.

The setup process
First setup device in Tapo, HA on your mobile and purchase BuzzKill.
All these apps mentioned must have power saving turned off and notifications on.
Setup an automation in Tapo for the device to send a notification.
The description is important as it will be what HA looks for, can be anything as you'll never see it thanks to BuzzKill.

Setup BuzzKill with the permissions it needs, yes it must be allowed to read all your notifications.
You can go into the app list and painfully limit it to the apps you want, minimum is Tapo.
Now deliberately trigger the Tapo automation and confirmed notification ok.
Open BuzzKill and you can either make it from new or use the history to make a rule on what you just triggered.
Set the rule to dismiss the notification immediately, HA will still have time to read it but it will be invisible to you.

In HA mobile settings -> companion app -> manage sensors -> last removed notification.
Enable the sensor and in the allow list add BuzzKill, Home Assistant and Tapo.
In HA server the mobile will have a sensor <device_name>_last_removed_notification
Make your automation target this, looking for the text the notification displays.

Important
There seems to be a bug or maybe limitation on this sensor.
If the automation triggers again and you haven't dismissed another notification nothing happens.
It seems to do nothing if the past and latest notification match.
This was the hardest to resolve, no amount of BuzzKill trickery would get it to work and there was only 1 solution.
A community member made a Python script which imitates the features HA dev tools allows by setting a sensor value.
You don't need HACS to install but you do need Python enabled in your configuration.yalm
Add python_script: to a new blank line and save.
Create python_scripts folder in your HA /config directory and save the downloaded set_state.py to the folder and reboot HA.
I had some issues getting the code working with their example so can use the below adding to the actions portion.

- data:
entity_id: sensor.<device_name>_removed_notification
state: ""
action: python_script.set_state

In my code it sets the value to nothing but you can set to whatever text you want.
If you do it through the GUI it's an action Python Scripts: set_state and in action data have just the lines entity_id and state.
Now when your automation triggers it resets the sensor so if the exact same notification happens it will still trigger.

Hope this workaround is helpful, pain to dream up but it works for now.

@SayantanRC
Copy link

SayantanRC commented Nov 16, 2024

@ados8 I have tried this approach before and this is not a very good approach.

  1. It requires the phone to have internet connectivity.
  2. Often times the notification isn't triggered (in my case on a Pixel 6a running A15, the notification arrives after I unlock the device).

In my opinion, the best workaround is Tapo -> Alexa -> Samsung SmartThings -> Home assistant. There's often a lag / latency of 3-4 seconds, but it does work reliably.

@ados8
Copy link

ados8 commented Nov 16, 2024

@ados8 I have tried this approach before and this is not a very good approach.

  1. It requires the phone to have internet connectivity.
  2. Often times the notification isn't triggered (in my case on a Pixel 6a running A15, the notification arrives after I unlock the device).

In my opinion, the best workaround is Tapo -> Alexa -> Samsung SmartThings -> Home assistant. There's often a lag / latency of 3-4 seconds, but it does work reliably.

Unfair statement in my opinion just because you had issues getting it to work.

  1. Literally stated it multiple times with warnings in the step guide.
  2. Advised that battery modes for the apps must be set to unrestricted so the phone doesn't put them to sleep.

Glad you have a working solution which wouldn't be required if vendors actually tried.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants