Hey All,
Slowly getting to grips with hass and it’s somewhat fantastic abilities! Really enjoying programming and thinking through all the automations I can do with this and my devices.
I am trying to think this through in terms of building a template and I hope someone can help point me in the right direction for!
So - I have a terrarium (turtle tank) which has a dimmer controlled light for the basking area - with a 1-wire temp sensor to read the temperature. I used to manage this with a Pi, however now plan to integrate this into hass. I have swapped the Pi out for an esp8266 and MQTT to hass.
So I get the temperature into hass as sensor.turtle_temperature. The next step, would be to have hass brighten / dim the socket (light.turtle_bask_dimmer) to regulate the temperature.
So far - have put this together:
- alias: Brighten turtle lamp trigger: - platform: numeric_state entity_id: sensor.turtle_temperature below: 26 condition: - condition: state entity_id: light.turtle_bask_dimmer state: 'on' action: - service: homeassistant.turn_on entity_id: light.turtle_bask_dimmer brightness:
Now what I want to do, is brighten the lamp by 50% (up to a maximum of 255). So if the lamp is currently at 128, increase the brightness to 192 then delay 1 minute.
I’ll also create another automation for dimming the lamp if the temperature exceed 28c.
The piece is the template / math I need to increase the brightness, and how to read the current value to work against. I have a feeling I might need to invoke a script instead?
Thanks in advance!