aioswitcher icon indicating copy to clipboard operation
aioswitcher copied to clipboard

Switcher breeze There are no buttons Assume on & Assume off

Open Roei639 opened this issue 2 years ago • 21 comments
trafficstars

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

Roei639 avatar Aug 12 '23 13:08 Roei639

Thanks for opening your first issue here!

welcome[bot] avatar Aug 12 '23 13:08 welcome[bot]

no Assume on & Assume off buttons in Home Assistant

Sound like this should be open in https://github.com/home-assistant/core.

TomerFi avatar Aug 13 '23 22:08 TomerFi

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

Roei639 avatar Aug 16 '23 16:08 Roei639

?

Roei639 avatar Aug 21 '23 06:08 Roei639

@TomerFi ??

Roei639 avatar Sep 17 '23 18:09 Roei639

I'm sorry, I don't have the capacity to handle this any time soon.

TomerFi avatar Sep 17 '23 18:09 TomerFi

I'm sorry, I don't have the capacity to handle this any time soon.

the problem is still there...

Roei639 avatar Jan 10 '24 20:01 Roei639

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?

TomerFi avatar Jan 10 '24 21:01 TomerFi

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

Roei639 avatar Jan 10 '24 21:01 Roei639

Screenshot_20240110_231148_Switcher Smart Home

Roei639 avatar Jan 10 '24 21:01 Roei639

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?

TomerFi avatar Jan 10 '24 21:01 TomerFi

@thecode I see you have explored this. Can you provide some info, please?

TomerFi avatar Jan 10 '24 21:01 TomerFi

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

thecode avatar Jan 10 '24 21:01 thecode

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.

YogevBokobza avatar Jan 13 '24 12:01 YogevBokobza

Update: I got an updated breeze db. Opened PR with the changes: https://github.com/TomerFi/aioswitcher/pull/749

YogevBokobza avatar Jan 17 '24 18:01 YogevBokobza

Merged.

TomerFi avatar Jan 18 '24 13:01 TomerFi

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.

thecode avatar Jan 18 '24 18:01 thecode

@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 avatar Feb 13 '24 19:02 thecode

@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 OnOffType is 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 OnOffType value.

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?

YogevBokobza avatar Apr 01 '24 17:04 YogevBokobza

@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 OnOffType is 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 OnOffType value.

@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 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).

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 avatar Apr 01 '24 17:04 thecode

@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 OnOffType is 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 OnOffType value.

@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 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).

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

YogevBokobza avatar Apr 01 '24 18:04 YogevBokobza

Is the problem found?

Roei639 avatar May 23 '24 10:05 Roei639

I have enabled the buttons for all devices

thecode avatar May 23 '24 18:05 thecode

I have enabled the buttons for all devices

In the next version of HA?

Roei639 avatar May 24 '24 05:05 Roei639