I have this script to turn on lights for 7 mins, but too often i get errors.
The script:
lights_on_7min:
alias: Luci Studio on 7 Minuti
sequence:
- service: light.turn_on
entity_id: light.philips_3
data:
brightness: 255
- service: light.xiaomi_miio_set_scene
entity_id: light.philips_5
data:
scene: '1'
- delay: 00:07:00
- service: light.turn_off
entity_id:
- light.philips_3
- light.philips_5
It is the error:
Error executing service <ServiceCall script.lights_on_7min (c:482179f83a2c412c84273e2c755a579c)>
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/core.py", line 1177, in _event_to_service_call
await service_handler.func(service_call)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/script.py", line 118, in service_handler
if script.is_on:
AttributeError: 'NoneType' object has no attribute 'is_on'
How to avoid ? What’s wrong?