started with homeAssist 3 days ago - amazing capabilities, I really think i like it. A lot of sensors, camera, AVR, SONOFF Pow - just integrated quite easy.
Obviously just started with the yaml configuration and would need a little push in the right direction for this one:
I have a SONOFF CT60 PIR (433Mhz) that reports to MQTT via SONOFF RF Bridge (Espurna)
Motion is triggered, but not cleared. I use expire_after and get ‘UNDEFINED’ on clear. Can i get a defined value (e.g. 0) on expire_after?
The MQTT messages look like below - its the same sensor, i need to cut off the first 8 characters for proper recognition Alternativly a match on the last chars would work, too.
I think you need to log into your sonoff and change (or determine) the payload_off:
It appears you can do it on the RF bridge
From the ESPurna web UI you can manage the stored codes. By default you have 6 ON/OFF pairs but you can change that in the configuration files, anyway it way more than the 4 codes the official app can handle. Once “learnt”, you can use them from the main status page, like you would with any other switch.
Interessting reply - didn’t consider to fix it in the Bridge. However, after thinking about it for a while, I still think I need to fix it in the HomeAssistant configuration.
I have Brennenstuhl Power Switches that work as you describe in the Bridge & HomeAssistant.
Espurna attaches a random ?6? chars in front of the PIR idea (compare 30DE01A404C4D263CE with 30F201A404C4D263CE). For different PIRs I’d like to substr that to C4D263CE to know if its LIVINGROOM or FLOOR
Even the bridge would only get the ‘Alert’ and not a ‘Alert reset’. Maybe the undefined that i have right now is good enough for logic, but for the charting reset to ‘0’ on expire would be nicer.
I use the community 433toMQTT ESP8266 set up, and need to use this automation to reset all my motion sensors to off or no motion as they only send a single detected message. You could adapt this automation to send Home Assistant to off command.
# MOTION SENSOR 1 - OFF TIMER #
- alias: 'Motion Sensor 1 - Off Timer'
# initial_state: 'on'
trigger:
platform: state
entity_id: binary_sensor.motion_1
to: 'on'
for:
seconds: 2
action:
service: mqtt.publish
data:
topic: 'home/433toMQTT'
payload: '2890473off'
retain: 'true'
The docu seems to indicate I could - however in reality I’m doing it wrong, i guess. I also read about ‘filter’ but don’t really find examples on how to apply those…
2018-04-15 11:00:57 ERROR (MainThread) [homeassistant.config] Invalid config for [sensor.mqtt]: invalid template (TemplateSyntaxError: Encountered unknown tag ‘regex_replace’.) for dictionary value @ data[‘value_template’]. Got ‘{% regex_replace(value, find=“63CE”, replace=“AS”, ignorecase=False) %}’. (See ?, line ?). Please check the docs at MQTT Sensor - Home Assistant