I am trying to set the value in an Input Number from another Input Number value in an automation. I know it is something simple, but I can’t get it or find an example. I get an “expected float for dictionary value @ data[‘value’]” error. I have tried float and int attributes with no success.
Thank you and @123. I missed the data_template, I still had only data. Interesting it appears this can’t be entered in the Configuration -> Automation Editor and has to be entered in the automation.yaml. When I look at the automation in the Automation Editor it has {} in the Service Data. Is there a way to express data_template in the Developer Tools when testing Services?
I’d recommend not using the automation UI when creating automations. I’ve always just typed out the automations in straight yaml because I found the automation UI to be harder to use. Plus it helps you understand yaml syntax better.
I don’t think it’s possible to use templates in the Services dev tool, but I’m not fully sure about that. That being said, you could use the Templates dev tool to test the template first and then use the output from that in the Services dev tool.
If you switch to the Visual Studio Code editor, it supports various Extensions to extend its functionality (this is fairly common for programming-oriented text editors). I would recommend installing the YAML extension (to validate YAML) and the Home Assistant Config Helper. It provides code-completion tailored for Home Assistant. For example, when creating an automation, it presents the available services in a list as well the entities you’ve defined.
Thanks- I like that option because I have used Visual Studio before. I tried the Hass.io Visual Studio Code Add-On previously and couldn’t get it working. Maybe not enough resources?
I use the VsCode Home Assistant plugin successfully (I spent some times to do so)
My Home Assistant runs inside a Docker instance on a Raspberry Pi 3b+
VsCode runs on my Mac OS on which à mounted (with NFS) the homeassistant folder like this sudo mount_nfs -o resvport [IP-RASPBERRY]:/usr/share/hassio/homeassistant /Users/[YOUR_MAC_USER]/[PATH_TO_MOUNT_POINT]/config
=> UID and GID must be the same on MAC and the Raspberry.
On VsCode I opened the config folder inside the NFS mounted directory (which is indeed the config folder of your home assistant on your PI).
I noticed that if I tried to open the home ‘home assistant’ directory the pluggin doesn’t work (too much latency).
I also noticed that sometimes I need to disable then enabled the plugin back.
Off course, you will need to configure correctly the plugin :
Vscode-home-assistant: http://[HASSIO_IP]:8123 (change the port if needed)
I was hoping someone could help me with my problem.
I’m trying to calculate an integer to use as a countdown the next day.
The integer is being calculated (as float initially) with the following formula: