#Turn on/off Shelly via luminance sensor

1 messages · Page 1 of 1 (latest)

grizzled swallow
#

I have an Inovelli mmwave switch with lux sensor and a shelly 1 mini. I want the Shelly to turn on when lux sensor is at 50 or less.

I have the below automation set up via GUI but it does not seem to do anything (Shelly never gets turned on when lx value changes)

alias: Kitchen-dark-sink-on
description: ""
triggers:
  - type: illuminance
    device_id: 3f485cfb77f9b493cb1d3af8408f5c8b
    entity_id: 436b814f6c1f3856a362134e86f9bc88
    domain: sensor
    trigger: device
    below: 50
conditions: []
actions:
  - type: turn_on
    device_id: 093d9bcb9eff7bb43ae33f5f14c75572
    entity_id: 0bad9acb3ad2ec86c57b4d2262bb082f
    domain: switch
mode: single
plucky flume
#

This trigger will likely work only when values goes from above 50 to below 50. So during the transition

#

I lso suggest you don't use the device_id and entity_id as these numbers, but actual entity_id with human readable format

grizzled swallow
#

I didn't create the yaml, I used the GUI in the app to select device, I didn't write out any device ids

#

I have tried and it didn't trigger when crossing the 50lx line

#

That is why I posted here, since it didn't do anything when the sensor shows it recognized the value changed (I shined flashlight at the Inovelli switch to simulate high light condition)

grizzled swallow
#

Decided to take my own advice and restart HA (have you tried turning it off and on again?), and the trigger works to run the automation now... Didn't have to manually edit the yaml that HA created via GUI to change any IDs, so that was a nice bit

snow tinsel
#

In the GUI you can also select an entity 🙂 No need to do any manual editing.

grizzled swallow
#

I did not do any manual editing, I selected devices in the GUI and it generated yaml using the device_id. I was following up on the comment to not use these IDs since I did not use them, HA did.

snow tinsel
#

I just follow up on @plucky flume that if you simply pick the entity rather then the device in the GUI, the yaml will already contain the readable entity id's 🙂 Which makes understanding the yaml a lot easier and easier to swap devices when you need to. We know you didn't change anything, that's kind of the point 😄

grizzled swallow
#

I guess I am confused... The list only shows devices, not entities, to select.

snow tinsel
#

That's because you start from the device which only uses device triggers/conditions. In the automation editor you can pick entities as well. And for most things also area's, labels and floors. Starting an automation in the automation editor gives more options / flexability.