aioswitcher
aioswitcher copied to clipboard
Switcher breeze There are no buttons Assume on & Assume off
What happened?
Hello, I installed a new breeze switcher and there are no Assume on & Assume off buttons in Home Assistant
Module Version
Integration Switcher Home Assistant
Device Type
Switcher Breeze
Firmware Version
2.20
Relevant log output
Version Home Assistant: 2023.8.2
Installation type: Docker
Pi4
Log is empty
Thanks for opening your first issue here!
no Assume on & Assume off buttons in Home Assistant
Sound like this should be open in https://github.com/home-assistant/core.
I opened in core. Below is the answer: According to the data we have from Switcher this device - SWTA7003 doesn't support assume state (called OnOffType) Please create an issue at aioswitcher maybe Switcher can supply an updated DB.
Link: https://github.com/home-assistant/core/issues/98369#issuecomment-1680365980
?
@TomerFi ??
I'm sorry, I don't have the capacity to handle this any time soon.
I'm sorry, I don't have the capacity to handle this any time soon.
the problem is still there...
I don't have this capacity, but I took another look. Based on what you wrote, I need to see how this can be resolved here.
According to the data we have from Switcher this device - SWTA7003 doesn't support assume state (called OnOffType) Please create an issue at aioswitcher maybe Switcher can supply an updated DB.
What do you suggest we do if a device of type SWTA7003 doesn't support the assumed state option?
I don't have this capacity, but I took another look. Based on what you wrote, I need to see how this can be resolved here.
According to the data we have from Switcher this device - SWTA7003 doesn't support assume state (called OnOffType) Please create an issue at aioswitcher maybe Switcher can supply an updated DB.
What do you suggest we do if a device of type SWTA7003 doesn't support the assumed state option?
In the Switcher app it is possible
Neither the app nor Switcher has anything to do with this project. So you're going to have to provide a bit more details. What's possible? What are you trying to do with the aioswithcer package?
@thecode I see you have explored this. Can you provide some info, please?
The decision if these buttons are available is done according to https://github.com/TomerFi/aioswitcher/blob/dev/src/aioswitcher/resources/irset_db.json with the relevant record for the remote above SWTA7003 (now I see that I already described it above). This is the relevant property which is incorrect: https://github.com/TomerFi/aioswitcher/blob/2dd895dc9738d0c987c9ea578e3077f1566b5a59/src/aioswitcher/api/remotes.py#L363 which HA later access via https://github.com/TomerFi/aioswitcher/blob/2dd895dc9738d0c987c9ea578e3077f1566b5a59/src/aioswitcher/api/remotes.py#L199 The data is already incorrect at the json file (I can't point to a line, the file is too big to show in GitHub)
Possible root causes:
- We need an updated file from Switcher, @YogevBokobza can you check this with them?
- They don't use the data in this file for their app, in this case we can't do anything
The decision if these buttons are available is done according to https://github.com/TomerFi/aioswitcher/blob/dev/src/aioswitcher/resources/irset_db.json with the relevant record for the remote above SWTA7003 (now I see that I already described it above). This is the relevant property which is incorrect:
https://github.com/TomerFi/aioswitcher/blob/2dd895dc9738d0c987c9ea578e3077f1566b5a59/src/aioswitcher/api/remotes.py#L363
which HA later access via https://github.com/TomerFi/aioswitcher/blob/2dd895dc9738d0c987c9ea578e3077f1566b5a59/src/aioswitcher/api/remotes.py#L199
The data is already incorrect at the json file (I can't point to a line, the file is too big to show in GitHub) Possible root causes:
- We need an updated file from Switcher, @YogevBokobza can you check this with them?
- They don't use the data in this file for their app, in this case we can't do anything
Sure I will check with the Switcher dev. I will report back.
Update: I got an updated breeze db. Opened PR with the changes: https://github.com/TomerFi/aioswitcher/pull/749
Merged.
I have reopen it since #749 does not fix it - https://github.com/TomerFi/aioswitcher/pull/749#issuecomment-1896655427 we are still waiting for a fix from Switcher.
@YogevBokobza when you talk to Switcher please ask again about the DB and how does the AC in this issue SWTA7003 have different properties in their App vs our DB?
@thecode I spoke with Switcher, here are the points I got from them:
- It looks like we have the latest db file for the remotes.
- They said that this
OnOffTypeis used for them for the logic of what happens if you are doing On and Off commands. (It looks like we have the logic as well in the code) - They do not use this parameter for their "Assume On/Off button" logic, they display that all the time regardless of this
OnOffTypevalue.
Regarding that, I think we should ignore this OnOffType state for the logic that shows/hides the "Assume On/Off" buttons in HA, display that all the time, and when press only update state and not send any command (as it looks like we are doing in HA code).
I saw this part of the code of HA: https://github.com/home-assistant/core/blob/master/homeassistant/components/switcher_kis/button.py#L49-L68
So I guess that supported=lambda remote: bool(remote.on_off_type) should be just supported=true or something like that..
@thecode What do you think?
@thecode I spoke with Switcher, here are the points I got from them:
- It looks like we have the latest db file for the remotes.
- They said that this
OnOffTypeis used for them for the logic of what happens if you are doing On and Off commands. (It looks like we have the logic as well in the code)- They do not use this parameter for their "Assume On/Off button" logic, they display that all the time regardless of this
OnOffTypevalue.
@YogevBokobza it repeats that we get contradicting answers from them. They don't display it all the time, you can check different ACs and see that this is changed, this is also exactly the opposite from what they instructed us in the past to use to know if the AC is a toggle AC or has separate on/off command.
Regarding that, I think we should ignore this
OnOffTypestate for the logic that shows/hides the "Assume On/Off" buttons in HA, display that all the time, and when press only update state and not send any command (as it looks like we are doing in HA code).
We can't ignore this logic, this is the exact logic we use to know if the AC has separate commands for on/off or it uses a single command. if you try to do it with an AC that doesn't support overriding the state the command will fail.
HA has strict rules about it and it is only allowed to override the state of the AC in case the AC is a type of AC that doesn't have a known state.
I am sorry but I am not going to peruse this further, if Switcher want a good support for their devices in Home Assistant they should provide us the correct data. If this flag is internal for them as you claim, they should add another flag that indicate if this AC is a toggle or not.
@thecode I spoke with Switcher, here are the points I got from them:
- It looks like we have the latest db file for the remotes.
- They said that this
OnOffTypeis used for them for the logic of what happens if you are doing On and Off commands. (It looks like we have the logic as well in the code)- They do not use this parameter for their "Assume On/Off button" logic, they display that all the time regardless of this
OnOffTypevalue.@YogevBokobza it repeats that we get contradicting answers from them. They don't display it all the time, you can check different ACs and see that this is changed, this is also exactly the opposite from what they instructed us in the past to use to know if the AC is a toggle AC or has separate on/off command.
Regarding that, I think we should ignore this
OnOffTypestate for the logic that shows/hides the "Assume On/Off" buttons in HA, display that all the time, and when press only update state and not send any command (as it looks like we are doing in HA code).We can't ignore this logic, this is the exact logic we use to know if the AC has separate commands for on/off or it uses a single command. if you try to do it with an AC that doesn't support overriding the state the command will fail.
HA has strict rules about it and it is only allowed to override the state of the AC in case the AC is a type of AC that doesn't have a known state.
I am sorry but I am not going to peruse this further, if Switcher want a good support for their devices in Home Assistant they should provide us the correct data. If this flag is internal for them as you claim, they should add another flag that indicate if this AC is a toggle or not.
I think you didn't understand my suggestion.. I don't think we should ignore the OnOffType logic and how it's handling the command to the AC itself, I mean that we could change this only line (https://github.com/home-assistant/core/blob/master/homeassistant/components/switcher_kis/button.py#L49-L68) to only show the "On/Off" buttons all the time and not based on on_off_type flag.
The logic in this button press is not sending any command packet to the remote and only updates its state as it sends update_state=True
Is the problem found?
I have enabled the buttons for all devices
I have enabled the buttons for all devices
In the next version of HA?