I have been working with rest_command with hass.services.call()
I am not sure what is the correct syntax. (maybe there is a better way? like http call directly from my python code?)
What I am trying to do is to avoid editing the configuration file every time I need to add/remove a link (under rest_command urls), since my list will be quite long.
So I prefer to plug in the list of URLs in my python code directly.
Any help would be highly appreciated.
Thank you All!
hass.services.call only calls home assistant objects, that’s why your top method works. You are feeding it a domian but not a entity_id in the domain.
You might be able to maintain a list of urls in your python code, then set the state of rest_command.home_1.attributes.url (not sure if that’s the correct syntax) to one of the items in your list, then call your service hass.services.call(‘rest_command’,‘home_1’)
Thank you very much @petro!
This sounds like a good idea. But I think, and you might agree, AppDaemon helps better in this area.
I am interested in complex automations with data from serial input and API calls as outputs so I have already moved on to AppDaemon and things are going well so far. Not much hassle with urls over there.