Hi, first time poster and quite new to Home Assistant. So hopefully I’m not breaking any site etiquette with this post (and sorry for the long post).
I’m currently converting my Hue and Smartlife devices to Home Assistant through hass.io. I’m having a issue about controlling lights in Lovelace. I want to use a floor layout and position my lights at their corresponding location and it is working Ok but I’m having issues controlling the lights that allow dimming that way. Below is the floor plan for my ground floor.
And Below is the curated version of the Lovelace script (only get the dimer to make things easier to read.
The tap action is working fine but the hold action is returning "Failed to call service script/g_bright_mode. Service not found.
You’ll see the script is there above the elements. I Tried to move it below as well as move it into scripts.yaml. To no avail, I can’t get it to work. If I replace “service: script.g_bright_mode” with “service:light.turn_on”, and change “input_light” for “entity_id”, I get instead “Failed to call service light/turn_on. must contain one of entity_id, area_id”.
If I move the call-service in the tap action instead of hold, it behaves the same way so I don’t think it’s related to it being in the hold section.
I already spent several hours on this, trying different things (the name of the script is actually something I found in a post in this community) and I’m stuck and can’t figure out what I’m doing wrong. Any help appreciated.
Edit: Replaced “service data” for “service_data”, copy/paste error.
Thanks for the quick reply. That’s actually what I had. It’s just with all the trials an errors I did, it ended up like that. I’ll correct the original post with an edit (if allowed here).
go to your config folder, and in there should be a file named ‘home-assistant.log’ or something like that. Use baretail or refresh the file after you use the ‘hold action’ to see what home assistant complains about.
As far as I know, a script needs to be in scripts.yaml. Can you move it there and then reload the scripts? Your syntax seems fine otherwise. The error points to the script not being found.
ALSO did NOT work! I got a “Failed to call service light/turn_on. must contain one of entity_id, area_id”. From the documentation, it should work. Don’t know what I’m doing wrong and it’s getting frustrating
I feel with you, it can be frustrating at times. To me, the code you posted seems fine. I can only advise you to pick 1 case you’d like help with, post the full code and be concise. And keep a good mood
Tried multiple methods. The script editor in Configuration, the one in Configurator plug-in, the built-in Lovelace manual editor and Notepadd++ (to cut and paste between both). Notepad++ might have added some tabs. I’ll check and make sure there are no tabs.
The built in editors didn’t report any issues though, but don’t know if it checks for space/tab and if it matters.
Great to hear that you got it working. From your example, I think your script is missing the entity_id? It would need something like you had in your very first example script: entity_id: '{{ input_light }}'
But if it’s working for you, just leave it be I guess!
Edit: I will forever remember one needs to call a GUI-generated script by its number, thanks.
Yeah, the real code is like this: (I didn’t use the script wizard so I could use real name and not meaningless numbers and used state-icon instead of image for ‘type’). One thing I did wrong with all my tests the other day is forgetting to reload the scripts. Lovelace doesn’t need to reload before being active but scripts do and I forgot about it