@VinceMulhollon wrote:
I have a reproducible problem when trying to create an automation for a Dyson fan for “night display mode”.
Fan works, app works. I can turn the fan on/off, also with automation. I can change speeds in an automation (tricky and undocumented but work around exists, bug filed elsewhere to either document the workaround or fix the bug).
Anyway I can’t change the display night_mode using automations, although dev tool works fine.
Log into most recent docker image, “Developer Tools” “services” tab. Service “dyson.set_night_mode”. Entity “fan.bedroom” (although I have two fans that both act the same way). Service data YAML optional “entity_id: fan.bedroom” and “night_mode: true” click “call service” it works perfectly the fan display goes into sleep dark mode and the entity in hass properly shows night mode has been entered and there are no errors in home-assistant.log. In other words, changing fan display night mode using the dev tool works absolutely perfectly as expected.
So the dev tool works “manually”. I would really like an automation to do exactly the same thing when trigger sun hits sunset every day, etc.
Now to reproduce the problem. I have multiple monitors, open another hass webpage and “Configuration” “Automations” “+” “skip” the almond stuff that never works for me, provide automation name (bedroom fan night mode on or similar), set a trigger like “sun” “sunset”. “Actions” “Action type call service” “service dyson.set_night_mode” “Names of the entities fan.bedroom” "service data “entity_id: fan.bedroom night_mode:true”. Not a typo that the automation looks visually identical content to the dev tool. Click the floppy disk to save (like does anyone under 40 know what a floppy diskette is?) it’ll save, scroll up and click “Execute” to test automation as you normally do. Fails to change physical fan state, no change in hass entity, home-assistant.log shows:
date time ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.bedroom_fan_night_mode_on. Invalid data for call_service at pos 1: value should be a string for dictionary value @ data['entity_id']"
I’ve tried all manner of changing the automation, trying to quote the name like its a string, deleting the entity_id in the YAML and relying on the GUI actions, everything I try either won’t save in the GUI resulting in a GUI error so I can not test it, or it saves and fails with similar error message. I used this exact example of failing to change night mode in an automation because it exactly matches the format and contents of an identical contents developer tools service that works absolutely perfectly as expected.
I have two monitors, I can look at a successful dev tools page while I look at a failing automation page and they’re identical no typos.
I’m curious if I have a major misunderstanding here, like if an action works perfectly in dev tools, it should just be copied right over to automations unchanged and it’ll work… correct?
Or maybe there’s something weird about Dyson and night mode, although if it works in the dev tools I don’t understand why it wouldn’t work in automations.
Anyway thanks for reading my headache and best of luck to you all.
Posts: 2
Participants: 1