RonnyW
March 28, 2023, 9:05am
387
@timvdhoorn @Edwin_Biemond
Can you please check the entity details in HA in developer tools?
There you should find the entity with it details, state and attributes.
In HA developer tool you can also execute service calls and check what services are possible for your plugs.
But as domain switch the entity should be able to react on. And its state should switch between “on” and “off”. Perhaps the zigbee2mqtt integration uses another entity state the HA app can’t handle
will do , see the same on z-wave js.
it seems z-wave js is the issue for me , zigbee ones are working.
RonnyW
March 28, 2023, 10:30am
391
Which of these entities is affected? switch.tv_switch?
Is it changing its state between on/off?
What happens when you switch it directly? Is the state changing in HA and Homey or only in HA?
As first workaround you can reconnect (button Homey device settings) or restart the app to be sure it has a websocket connection and devices are registered on entity changes.
Edit: a technical detail that doesn’t fit to the situation…
Homey app sends a service call that’s switching the HA switch.
After that the entity change is reported back to Homey and that should update the switch device. And that shouldn’t do anything because HA should send back the current (changed) state.
So it seems the Websocket connection is ok, but there is something wrong with the state coming from HA.
If you need more details please let me know.
will try it all tonight on a not so important z-wave socket. will let you know.
For me it is an Zigbee2MQTT plug. So it looks like it has something to do with the integration.
If I switch the plug from OFF to ON in HA the same thing happens
RonnyW
March 28, 2023, 3:37pm
395
@timvdhoorn @Edwin_Biemond
Can you make this check in HA, please?
developer tools, events:
Enter the event “state_changed” and start listening. Please prepare your HA page in a second tab before because there will be many events raised with this type.
Now change the switch state in HA.
Now you should see the event in the log:
The element new_state/state should have value “on” when you switched the plug on.
After switching the plug off the new state should be “off”.
That’s the event Homey is listen on. And based on this event, the Homey device state is set.
So I can turn it on from homey (and stayed on in HA ) but 3 seconds later got turned off again back,
RonnyW
March 28, 2023, 6:20pm
397
Did you check the event content in HA (last post)?
yes
event_type: state_changed
data:
entity_id: sensor.bedroom_switch_power
old_state:
entity_id: sensor.bedroom_switch_power
state: "5.8"
attributes:
state_class: measurement
unit_of_measurement: W
device_class: power
friendly_name: bedroom switch Power
last_changed: "2023-03-28T18:20:54.138067+00:00"
last_updated: "2023-03-28T18:20:54.138067+00:00"
context:
id: 01GWMQ75ZT2J963PKW5GHRGAK7
parent_id: null
user_id: null
new_state:
entity_id: sensor.bedroom_switch_power
state: "16.2"
attributes:
state_class: measurement
unit_of_measurement: W
device_class: power
friendly_name: bedroom switch Power
last_changed: "2023-03-28T18:20:55.115152+00:00"
last_updated: "2023-03-28T18:20:55.115152+00:00"
context:
id: 01GWMQ76YBSR6ASZ83EZP7VVZA
parent_id: null
user_id: null
origin: LOCAL
time_fired: "2023-03-28T18:20:55.115152+00:00"
context:
id: 01GWMQ76YBSR6ASZ83EZP7VVZA
parent_id: null
user_id: null
event_type: state_changed
data:
entity_id: sensor.bedroom_switch_power
old_state:
entity_id: sensor.bedroom_switch_power
state: "4.1"
attributes:
state_class: measurement
unit_of_measurement: W
device_class: power
friendly_name: bedroom switch Power
last_changed: "2023-03-28T18:20:53.637093+00:00"
last_updated: "2023-03-28T18:20:53.637093+00:00"
context:
id: 01GWMQ75G5GTG556S1TJ3VRSTT
parent_id: null
user_id: null
new_state:
entity_id: sensor.bedroom_switch_power
state: "5.8"
attributes:
state_class: measurement
unit_of_measurement: W
device_class: power
friendly_name: bedroom switch Power
last_changed: "2023-03-28T18:20:54.138067+00:00"
last_updated: "2023-03-28T18:20:54.138067+00:00"
context:
id: 01GWMQ75ZT2J963PKW5GHRGAK7
parent_id: null
user_id: null
origin: LOCAL
time_fired: "2023-03-28T18:20:54.138067+00:00"
context:
id: 01GWMQ75ZT2J963PKW5GHRGAK7
parent_id: null
user_id: null
event_type: state_changed
data:
entity_id: sensor.bedroom_switch_power
old_state:
entity_id: sensor.bedroom_switch_power
state: "0.0"
attributes:
state_class: measurement
unit_of_measurement: W
device_class: power
friendly_name: bedroom switch Power
last_changed: "2023-03-28T18:19:49.141834+00:00"
last_updated: "2023-03-28T18:19:49.141834+00:00"
context:
id: 01GWMQ56GN29XRCRRW3PATVBWF
parent_id: null
user_id: null
new_state:
entity_id: sensor.bedroom_switch_power
state: "4.1"
attributes:
state_class: measurement
unit_of_measurement: W
device_class: power
friendly_name: bedroom switch Power
last_changed: "2023-03-28T18:20:53.637093+00:00"
last_updated: "2023-03-28T18:20:53.637093+00:00"
context:
id: 01GWMQ75G5GTG556S1TJ3VRSTT
parent_id: null
user_id: null
origin: LOCAL
time_fired: "2023-03-28T18:20:53.637093+00:00"
context:
id: 01GWMQ75G5GTG556S1TJ3VRSTT
parent_id: null
user_id: null
event_type: state_changed
data:
entity_id: switch.bedroom_switch
old_state:
entity_id: switch.bedroom_switch
state: "off"
attributes:
friendly_name: Bedroom switch
last_changed: "2023-03-28T18:19:48.345238+00:00"
last_updated: "2023-03-28T18:19:48.345238+00:00"
context:
id: 01GWMQ55NMF5WP448VAHBEXS5T
parent_id: null
user_id: 7391c63f75f04ee0a61be7dc7cdb181e
new_state:
entity_id: switch.bedroom_switch
state: "on"
attributes:
friendly_name: Bedroom switch
last_changed: "2023-03-28T18:20:52.808825+00:00"
last_updated: "2023-03-28T18:20:52.808825+00:00"
context:
id: 01GWMQ74MA78CW52P4SZKGTMYW
parent_id: null
user_id: 7391c63f75f04ee0a61be7dc7cdb181e
origin: LOCAL
time_fired: "2023-03-28T18:20:52.808825+00:00"
context:
id: 01GWMQ74MA78CW52P4SZKGTMYW
parent_id: null
user_id: 7391c63f75f04ee0a61be7dc7cdb181e
off and on from HA
top 3 rows on homey
event_type: state_changed
data:
entity_id: sensor.bedroom_switch_power
old_state:
entity_id: sensor.bedroom_switch_power
state: "0.0"
attributes:
state_class: measurement
unit_of_measurement: W
device_class: power
friendly_name: bedroom switch Power
last_changed: "2023-03-28T18:30:35.838650+00:00"
last_updated: "2023-03-28T18:30:35.838650+00:00"
context:
id: 01GWMQRY1YM8B0NPQ934ECRWME
parent_id: null
user_id: null
new_state:
entity_id: sensor.bedroom_switch_power
state: "16.0"
attributes:
state_class: measurement
unit_of_measurement: W
device_class: power
friendly_name: bedroom switch Power
last_changed: "2023-03-28T18:30:40.613408+00:00"
last_updated: "2023-03-28T18:30:40.613408+00:00"
context:
id: 01GWMQS2Q5WPR6SPR9PX898XDA
parent_id: null
user_id: null
origin: LOCAL
time_fired: "2023-03-28T18:30:40.613408+00:00"
context:
id: 01GWMQS2Q5WPR6SPR9PX898XDA
parent_id: null
user_id: null
event_type: state_changed
data:
entity_id: switch.bedroom_switch
old_state:
entity_id: switch.bedroom_switch
state: "off"
attributes:
friendly_name: Bedroom switch
last_changed: "2023-03-28T18:30:35.095491+00:00"
last_updated: "2023-03-28T18:30:35.095491+00:00"
context:
id: 01GWMQRX7WV4SV43P35KDFNJW9
parent_id: null
user_id: 7391c63f75f04ee0a61be7dc7cdb181e
new_state:
entity_id: switch.bedroom_switch
state: "on"
attributes:
friendly_name: Bedroom switch
last_changed: "2023-03-28T18:30:39.830324+00:00"
last_updated: "2023-03-28T18:30:39.830324+00:00"
context:
id: 01GWMQS1WH9AQ1S2186Q8R6ZB8
parent_id: null
user_id: 7391c63f75f04ee0a61be7dc7cdb181e
origin: LOCAL
time_fired: "2023-03-28T18:30:39.830324+00:00"
context:
id: 01GWMQS1WH9AQ1S2186Q8R6ZB8
parent_id: null
user_id: 7391c63f75f04ee0a61be7dc7cdb181e
event_type: state_changed
data:
entity_id: sensor.bedroom_switch_power
old_state:
entity_id: sensor.bedroom_switch_power
state: "25.3"
attributes:
state_class: measurement
unit_of_measurement: W
device_class: power
friendly_name: bedroom switch Power
last_changed: "2023-03-28T18:22:23.137937+00:00"
last_updated: "2023-03-28T18:22:23.137937+00:00"
context:
id: 01GWMQ9WX1WVBZS2P5NNE04HZB
parent_id: null
user_id: null
new_state:
entity_id: sensor.bedroom_switch_power
state: "0.0"
attributes:
state_class: measurement
unit_of_measurement: W
device_class: power
friendly_name: bedroom switch Power
last_changed: "2023-03-28T18:30:35.838650+00:00"
last_updated: "2023-03-28T18:30:35.838650+00:00"
context:
id: 01GWMQRY1YM8B0NPQ934ECRWME
parent_id: null
user_id: null
origin: LOCAL
time_fired: "2023-03-28T18:30:35.838650+00:00"
context:
id: 01GWMQRY1YM8B0NPQ934ECRWME
parent_id: null
user_id: null
event_type: state_changed
data:
entity_id: switch.bedroom_switch
old_state:
entity_id: switch.bedroom_switch
state: "on"
attributes:
friendly_name: Bedroom switch
last_changed: "2023-03-28T18:20:52.808825+00:00"
last_updated: "2023-03-28T18:20:52.808825+00:00"
context:
id: 01GWMQ74MA78CW52P4SZKGTMYW
parent_id: null
user_id: 7391c63f75f04ee0a61be7dc7cdb181e
new_state:
entity_id: switch.bedroom_switch
state: "off"
attributes:
friendly_name: Bedroom switch
last_changed: "2023-03-28T18:30:35.095491+00:00"
last_updated: "2023-03-28T18:30:35.095491+00:00"
context:
id: 01GWMQRX7WV4SV43P35KDFNJW9
parent_id: null
user_id: 7391c63f75f04ee0a61be7dc7cdb181e
origin: LOCAL
time_fired: "2023-03-28T18:30:35.095491+00:00"
context:
id: 01GWMQRX7WV4SV43P35KDFNJW9
parent_id: null
user_id: 7391c63f75f04ee0a61be7dc7cdb181e
looks like power event sensor.bedroom_switch_power has no state like on or off and maybe it is considered as off
this comes after switch.bedroom_switch on event
RonnyW
March 28, 2023, 6:49pm
401
I finally found the reason
It’s indeed the combination of switch entity and power entity. A check for main device entity_id is missing. So it’s switching on and directly aftert that switching off because the power entity is also parsed and it’s state is not “on”.
I’ll add a fix. But as I’m currently working on other additions it could take 2 or 3 days. As workaround you can try to deactivate the power entity in device settings. This should remove the second cabapiliy/entity. Just as a thought - haven’t tested it.
2 Likes
Does anyone have an idea how to fix this?
I have a Xiaomi WXKG01LM Button switch added in HA. Now I added this button in Homey and try to add an action to the text value ‘single’. but this value changes so fast that it is not registered. I checked the logs of Zigbee2MQTT and I see it is changing really fast back to “”.
Does someone maybe got an idea how to solve this (sorry if this isn’t completely related to this app.
[Screenshot 2023-03-27 at 22.17.36]
Thanks!
RonnyW
March 28, 2023, 7:01pm
403
Is it a button or a switch?
Has it a HA entity with persistent state?
you work too hard. take it slow before you know homey will be an expensive console, flow only engine or a satellite of HA
It is a 1 click button.
When clicked there will be a action with ‘single’ , ‘double’ etc. But what happens is that it will be on that state for less than a second and bounces back to an empty state.
RonnyW
March 28, 2023, 7:14pm
406
Haha. Yes, take the best of both systems. HA is good, but HA can’t offer something like AdvancedFlows.
I probably only use 10% of the app. But I love to push the limits
1 Like