my room light for configuration.yaml in HA as below
# Room Light
- platform: template
switches:
room_light:
turn_off:
# nothing now
turn_on:
# nothing now
but I want to do turn_off, turn_on via AppDamon’s methods.
Is there any idea for this?
Actually, I want to add my lights into HA and the ligths are controlled by REST API(apartment server)
However, I need to add “access_token” into header for every APIs.
I can retrive “access_token” with login API and it’s expired in every hours.
So I’m trying to make it with python script in AppDaemon, not using RESTful switch or commands.
HA
- Call AppDaemon’s method for turn on / off and states.
(Don’t need to care about acess tokens, something…)
AppDaemon
- Retrive access_token in every 1 hours
- If called turn_on or turn_off commands from HA, using access token to call apartment’s API.
Is there any way to call AppDaemon’s method from HA?
You can look my previous method to understand in my situation lol
https://community.home-assistant.io/t/how-can-i-integrate-my-lights-into-home-assistant-controlled-by-rest-api