From 985159e51787205b9640b65f03f5637e91a8065f Mon Sep 17 00:00:00 2001 From: Rich O Date: Wed, 27 Nov 2019 14:19:48 -0500 Subject: [PATCH] trying to turn on light using services turn_on --- r0b3bot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/r0b3bot.py b/r0b3bot.py index 6bfa55b..7575375 100644 --- a/r0b3bot.py +++ b/r0b3bot.py @@ -253,8 +253,9 @@ async def printstat(ctx): try: # REST API call to home assistant to turn the light off. #remote.call_service(hassapi, 'switch', 'turn_on', {'entity_id':'{}'.format(HASS_LIGHT)}) + hassAPIRUL = "https://" + HASS_IP_ADDRESS + "/api/services/switch/turn_on" payload = { - "state":"on" + "entity": HASS_LIGHT } requests.post(hassURL, data=payload, headers=hassHEADERS) except: -- 2.39.5