RaspBee ZigBee

I used the “command_line switch” and a py-script to control the lights. I works fine but there is a delay (about 3-4 seconds) when I switch from on to off an vice versa.

Example configuration.yaml entry

switch:

  • platform: command_line
    switches:
    autoremote:
    command_on: ‘python3 /home/homeassistant/.homeassistant/son.py’
    command_off: ‘python3 /home/homeassistant/.homeassistant/soff.py’

onoff.py

import requests
import json
payload = “{“on”: false}”
payload = “{“on”: true}”
url = “http://192.168.0.6:8011/api/F659352645/lights/1/state
headers = {“Content-Type”: “application/json”}
r = requests.put(url, data=payload, headers=headers)