Question from a newbie

Can someone tell me which is basically the difference between the light.turn_on/off and homeassistant.turn_on/off services about lighting up lights?
Sorry if the question is stupid, but as newbie you will understand me…

Functionally, there is no difference.

light.turn_off will complain if what it is asked to turn off is not a light, but home_assistant.turn_off will turn anything off that has a turn_off method.

Thanks, ok, now i understand… So if there is light as device i can use both similarly, but if there is NO light i MUST use homeassistant.tun_on/off… right?

Well there are turn_on/turn_off methods for a lot of components other than lights - switches, automations etc. and they will only work for the correct component. But homeassistant.turn_off will turn any of them off.

2 Likes