Hey there
Hoping someone can help me - I’m trying to set the brightness of two lights based on the actual outside brightness. I so far have a sensor setup that is reading brightness via MQTT and is available as sensor.outside_brightness with int value between 1 and 255.
Sensor config:
- platform: mqtt
state_topic: "kleikamp_brightness"
name: "Outside Brightness"
unit_of_measurement: "bright"
value_template: '{{ value_json.Brightness }}'
Automation config:
- id: matchbrightness
alias: Match Outside Brightness
trigger:
platform: mqtt
topic: kleikamp_brightness
action:
service: light.turn_on
entity_id:
- light.floalt_panel_ws_60x60
- light.floalt_panel_ws_60x60_2
data:
brightness: '{{ states.sensor.outside_brightness }}'
I get the error:
Jun 18 15:41:55 localhost hass[6677]: ERROR:homeassistant.core:Invalid service data for light.turn_on: expected int for dictionary value @ data['brightness']. Got '{{ states.sensor.outside_brightness }}'
Obviously it’s not getting passed the actual value - I’ve tried sensor.outside_brightness also with no joy… any ideas?