First a big “thank you” for sharing this informations and code!
I did it as described in strategy 2 and it work fine!
But I have one sensor (fire sensor) which is alway “demuxed” in topic unknown, although the payload of the fire sensor is part of de python script.
python-script (payload on line 15:
d = { '0CD102':['sonoff_button_home_a','ON','false'],
'0CD108':['sonoff_button_home_b','ON','false'],
'0CD101':['sonoff_button_home_c','ON','false'],
'0CD104':['sonoff_button_home_d','ON','false'],
'EDB0C1':['sonoff_button_key_M_arm_away','ON','false'],
'EDB0C2':['sonoff_button_key_M_disarm','ON','false'],
'EDB0C4':['sonoff_button_key_M_arm_home','ON','false'],
'EDB0C8':['sonoff_button_key_M_sos','ON','false'],
'FBFF1E':['sonoff_pir_keller_tuere','ON','true'],
'FC302E':['sonoff_pir_keller_fenster','ON','true'],
'D2792E':['sonoff_pir_eingang_aussen','ON','true'],
'14CA83':['sonoff_housedoor_lockstatus','ON','true'],
'14CA89':['sonoff_housedoor_lockstatus','OFF','true'],
'CA7169':['sonoff_water_waschmaschine','ON','true'],
'623476':['sonoff_fire_waschkueche','ON','true'],
'620602':['somfy_cover_alle_storen_up','ON','false'],
'620604':['somfy_cover_alle_storen_stop','ON','false'],
'620608':['somfy_cover_alle_storen_down','ON','false'],
'620612':['somfy_cover_sitzplatz_up','ON','false'],
'620614':['somfy_cover_sitzplatz_stop','ON','false'],
'620618':['somfy_cover_sitzplatz_down','ON','false'],
'620622':['somfy_cover_essen_up','ON','false'],
'620624':['somfy_cover_essen_stop','ON','false'],
'620628':['somfy_cover_essen_down','ON','false'],
'620632':['somfy_cover_balkon_up','ON','false'],
'620634':['somfy_cover_balkon_stop','ON','false'],
'620638':['somfy_cover_balkon_down','ON','false'],
'620642':['somfy_cover_wohnen_up','ON','false'],
'620644':['somfy_cover_wohnen_stop','ON','false'],
'620648':['somfy_cover_wohnen_down','ON','false'],
'620652':['somfy_cover_strasse_up','ON','false'],
'620654':['somfy_cover_strasse_stop','ON','false'],
'620658':['somfy_cover_strasse_down','ON','false'],
'620662':['somfy_cover_sonnenstore_up','ON','false'],
'620664':['somfy_cover_sonnenstore_stop','ON','false'],
'620668':['somfy_cover_sonnenstore_down','ON','false'],
'620672':['somfy_cover_alle_lamellen_up','ON','false'],
'620674':['somfy_cover_alle_lamellen_stop','ON','false'],
'620678':['somfy_cover_alle_lamellen_down','ON','false'],
'620682':['velux_cover_carmen_up','ON','false'],
'620684':['velux_cover_carmen_stop','ON','false'],
'620688':['velux_cover_carmen_down','ON','false']
}
p = data.get('payload')
if p is not None:
if p in d.keys():
service_data = {'topic':'home/{}'.format(d[p][0]), 'payload':'{}'.format(d[p][1]), 'qos':0, 'retain':'{}'.format(d[p][2])}
else:
service_data = {'topic':'home/unknown', 'payload':'{}'.format(p), 'qos':0, 'retain':'false'}
logger.warning('<rfbridge_demux> Received unknown RF command: {}'.format(p))
hass.services.call('mqtt', 'publish', service_data, False)
binary_sensor.yaml
- platform: mqtt
name: 'sonoff_fire_waschkueche'
state_topic: 'home/sonoff_fire_waschkueche'
device_class: smoke
And this is what I get in tasmota console as payload:
And this ist what’sin MQTT-Broker: