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

Android Switch Widget can't deal with off as hvac value, value gets "converted" to false #3715

Closed
harrybin opened this issue Jul 26, 2023 · 5 comments · Fixed by #3858
Closed
Labels
bug Something isn't working widget

Comments

@harrybin
Copy link

Home Assistant Android app version(s):
2023.7.5-full
Android version(s):
13 (5. July 2023)
Device model(s):
Pixel 7 pro
Home Assistant version:
2023.5.4
Last working Home Assistant release (if known):

Description of problem, include YAML if issue is related to notifications:

  • Create a switch widget like
    • service: climate.set_hvac_mode
    • EnityId: climate.myHeating
    • Hvac Mode: off
  • save the widget
  • try it, it will no work
  • edit the widgest again
  • --> you will see the Hvac Mode: off chaged to Hvac Mode: false

Additional information:
I also tried 'off' and "off", those are not "converted" to false, but still the switch does not work.
If I set heat as mode it works as expeted, but I'm not able to set off which changed to falseon saving the widget.

@harrybin harrybin added the bug Something isn't working label Jul 26, 2023
@dshokouhi
Copy link
Member

can you please get us the companion app logs when you save the widget and tap on it? it contains the service data we send so its good to look at what the app is trying.

@harrybin
Copy link
Author

harrybin commented Jul 26, 2023

Hi,
please find the log attached.
It seems like the value is converted by the UI:
image

[homeassistant_companion_log_6

scrcpy_s9vSwGo8PH.mp4

-26-2023_18-30-0.txt](https://github.com/home-assistant/android/files/12175050/homeassistant_companion_log_6-26-2023_18-30-0.txt)

If I can help or do any assistance, please let me know.

@jpelgrom
Copy link
Member

jpelgrom commented Jul 26, 2023

This appears to be 'intentional':

Edit: to properly fix this the app would really need to support a selector and it's values, which is what is used here: "set_hvac_mode":{"name":"Set HVAC mode","description":"Set HVAC operation mode for climate device.","fields":{"hvac_mode":{"name":"HVAC mode","description":"New value of operation mode.","selector":{"select":{"options":[{"label":"Off","value":"off"},{"label":"Auto","value":"auto"},{"label":"Cool","value":"cool"},{"label":"Dry","value":"dry"},{"label":"Fan Only","value":"fan_only"},{"label":"Heat/Cool","value":"heat_cool"},{"label":"Heat","value":"heat"}]}}}},"target":{"entity":[{"domain":["climate"]}]}}

@harrybin
Copy link
Author

harrybin commented Jul 26, 2023

right, seems to be some general conversion.
But wrong in this case.
However meanwhile I helped myself by creating a script to trigger the off mode instead of the HVAC_mode change action in the widget:

domain: climate
entity_id: climate.pool_heizung
type: set_hvac_mode
hvac_mode: "off"

This works.

@Xeio
Copy link

Xeio commented Sep 11, 2023

Same issue with "climate.set_fan_mode" and the "Fan Mode" parameter. "on" is converted to "true" which isn't a valid value by the Ecobee integration. Off has the same problem but Ecobee uses "auto" in that case so it doesn't matter as much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working widget
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants