Using an automation, I want to change the hidden attribute on a bunch MQTT sensors when I receive a payload from one of them. Using pushbullet to test my automation is triggering, but I’m having a hard time figuring out how to change the hidden attributes through an action. Here is what my pushbullet test…
- alias: 'apple is on'
trigger:
platform: mqtt
topic: 'pis/apple/last-seen'
condition:
- condition: template
value_template: '{{ states.sensor.apple_last_seen.attributes.hidden != True }}'
action:
service: notify.pushbullet
data_template:
title: 'apple is on'
message: 'apple - on'
Then I’ll have another automation which checks to see if states.sensor.apple_last_seen.attributes.hidden
is true
and the datetime in the state is a couple of minutes old.
Can anyone give me an example of how to change state attributes for a MQTT sensor? Thanks!