I have a cover set up to open and close my chicken coop door at sunrise and sunset. All works well, i want to have a message sent when the sensor confirms that the door is closed, not from the close automation command…
The following is from the console of the sonoff when i toggle the sensor.
13:17:59 MQT: cmnd/coopstate/POWER2 = OFF (retained)
13:18:00 MQT: cmnd/coopstate/POWER2 = ON (retained)
13:21:02 MQT: tele/sonoffcoop/STATE = {"Time":"2019-08-06T13:21:02","Uptime":"3T21:47:59","Vcc":3.178,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"POWER1":"ON","POWER2":"OFF","Wifi":{"AP":1,"SSId":"Keith","BSSId":"A0:F3:C1:E4:7D:FD","Channel":11,"RSSI":76,"LinkCount":3,"Downtime":"0T00:00:18"}}
This is my cover setup.
cover:
- platform: mqtt
name: "Sonoff Coop"
state_topic: "cmnd/coopstate/POWER2"
command_topic: "cmnd/sonoffcoop/power1"
payload_open: "ON"
payload_close: "OFF"
payload_stop: "ON"
state_open: "ON"
state_closed: "OFF"
retain: true
This is the automation, but I am unsure of what entity_id to use or state?
- alias: Announce Coop door closed
trigger:
platform: state
entity_id: ????
???
action:
service: tts.google_say
data:
entity_id: media_player.living_room_speaker
message: "The coop door is closed"
Any advice would be appreciated.