Multiple Template Rule based on times for percentage

Thanks Ghassan.
Yeah as people have mentioned before to do it that way but I wanted to restrict to one sensor.

This way actually makes more sense to be fair.

Will change it shortly

1 Like

I made another tweak, decided to add the ‘fallback’ of 100% to a custom helper as I don’t like anything hard coded :stuck_out_tongue:

I also wanted to share the other things I have for my light automations, maybe it’ll inspire some people :slight_smile:

Main switch for Home Assistant to take control of the lights and turn on with motion.
(Added this when transitioning from Smarthings/Philips Hue)
image

Automation times… So the lights will turn on with motion if within these times…
OR you can “Use the Sun” which will use the sunrise / sunset.
image

Minutes to turn off the lights after no motion
image

Light notification timer which pushes a notification to my mobile with options to turn off the light, or, replay the message (so if I’m sat in the room, I’ll replay the message)
image

and finally, after this thread, an update on the times & brightness :smiley:
image

Hi @91JJ,.

Very nice :slight_smile:

Just a couple of comments:

  • Use the sun elevation attribute rather than sunset/sunrise times (state above/Below horizon). It will give you a more consistent reference wrt the amount of light. Example I hade once an automation of outdoor light, that triggers on when elevation < 1.
    for details see: Sun - Home Assistant

To be even more precise ( if you have a Zigbee hub)

  • you can use the aqara motion sensor that also includes a brightness sensor and have a condition like sensor brightness level > 20 Lux.

Be aware this sensor only updates the brightness value on motion detection ( I didn’t know that before I tried it)

  • Alternatively use the mi light sensor, that always have a updated brightness value.

https://www.amazon.de/-/en/YTC4043GL-Mi-Light-Detection-Sensor/dp/B094MQC8V1/ref=sr_1_9?crid=DKFBG3QVDOE&keywords=mi+lichtsensor&qid=1648124597&s=diy&sprefix=mi+light+sensor%2Cdiy%2C97&sr=1-9

These are the light sensors I know. Probably there are others and maybe with no need for a hub

Kind regards,
Ghassan

1 Like

Hey @ghassan,

Thanks for that!
Agreed, I may change over to the elevation, that makes much more sense!

And YES! … the later step is to add in a Lux sensor, so I can use

  • Manual times
  • Sun Elevation
  • LUX

I’m hoping to do this with ESP Home as I’m currently building my own sensors

1 Like

I also considered making my own Esp based light sensor, but preffered the small, nice looking, easy to mount (magnet back), battery driven (at least 1 year battery life) and at nearly same cost, standard product :slight_smile:

Given that I already had a Zigbee Hub.

1 Like

haha yes, I know exactly what you mean!
I found it nice to have a “plug and play” - however, I think the ESP can add multiple sensors for the price of one off the shelf now :frowning:

I bought all the kit to make 5 motion sensors with LUX, Temp, LED, Humid & a couple more sensors for the same price as a Samsung Smartthings motion sensor!

Plus, no need for the hub, but does go over WiFi :frowning:
Pro’s and Cons either way I suppose!