Tasmota/sonoff
Laurent dd27ade7ef Rules: Trigger Event with MQTT Subscriptions
Support subscribe/unsubscribe MQTT topics and trigger specified event with the subscribed MQTT topic.
You can subscribe a MQTT topic and assign an event name. Once we received subscribed MQTT message, an event will be automatically triggered. So you can set up a rule with "ON EVENT#<event_name> DO ..." to do whatever you want based on this MQTT message. The payload is passed as a parameter once the event been triggered. If the payload is in JSON format, you are able to get the value of specified key as parameter.
For example, if you have a Tasmota based thermostat and multiple temperature sensors in different place, usually you have to set up a centre home automation system like Domoticz to control the thermostat. Right now, with this new feature, you can write a rule to do this.
Two new commands in Rules:
1. Subscribe
Subscribe a MQTT topic (with or without key) and assign an event name to it.
Command format:
	Subscribe [<event_name>, <topic> [, <key>]]
		This command will subscribe a <topic> and give it an event name <event_name>.
		The optional parameter <key> is for parse the specified key/value from MQTT message
			payload with JSON format.
		In order to parse value from two level JSON data, you can use one dot (".") to split the key into two section.
		Subscribe command without any parameter will list all topics currently subscribed.
2. Unsubscribe
Unsubscribe specified MQTT event.
Command format:
	Unsubscribe [<event_name>]
		Unsubscribe a topic subscribed by specify the event name.
		If no event specified, Unsubscribe all topics subscribed.
Examples:
1.
	Subscribe BkLight, Tasmota/BackyardLight/stat/POWER
		And define a rule like:
	Rule1 on event#BkLight=ON do ruletimer4 60 endon
2.
	Subscribe DnTemp, Tasmota/RoomSensor1/stat/SENSOR, DS18B20.Temperature
		Define a rule to deal with the MQTT message like {"Time":"2017-02-16T10:13:52", "DS18B20":{"Temperature":20.6}}
	Rule1 ON EVENT#DnTemp>=21 DO ... ENDON
2019-02-23 22:33:09 -05:00
..
language Rules: Trigger Event with MQTT Subscriptions 2019-02-23 22:33:09 -05:00
Parsing.cpp Fix Alexa bug in Core 2.4.2. 2019-01-28 17:53:25 +01:00
_changelog.ino Fix command WebSend 2019-02-22 15:19:59 +01:00
core_esp8266_timer.c Disable patched core PWM 2019-01-27 12:42:05 +01:00
core_esp8266_wiring_digital.c Disable patched core PWM 2019-01-27 12:42:05 +01:00
core_esp8266_wiring_pwm.c Disable patched core PWM 2019-01-27 12:42:05 +01:00
i18n.h Add missing localization strings 2019-02-21 19:45:21 +01:00
my_user_config.h Rules: Trigger Event with MQTT Subscriptions 2019-02-23 22:33:09 -05:00
settings.h Add flag for no hold retain 2019-02-21 21:27:52 +01:00
settings.ino Add configuration parameter to send MQTT telemetry on status change (SetOption59) 2019-02-17 22:05:02 +01:00
sonoff.h Implement WifiConfig 7 2019-02-21 17:49:11 +01:00
sonoff.ino Fix some exceptions and watchdogs 2019-02-22 12:04:05 +01:00
sonoff_letsencrypt.h 6.4.1.4 Update Copyright (C) 2019 2019-01-01 13:55:01 +01:00
sonoff_post.h Change image defines 2019-02-08 14:55:45 +01:00
sonoff_template.h Update sonoff_template.h 2019-02-18 16:19:46 +01:00
sonoff_version.h 6.4.1.18 - Fix some exceptions and watchdogs 2019-02-21 14:31:31 +01:00
support.ino Update support.ino 2019-02-22 12:11:15 +01:00
support_button.ino Remove command SetOption62 2019-02-17 16:05:53 +01:00
support_features.ino Merge branch 'development' into sm16716 2019-02-08 20:00:53 +04:00
support_rotary.ino 6.4.1.16 Online template change 2019-02-11 19:21:49 +01:00
support_rtc.ino Update support_rtc.ino 2019-02-23 17:41:06 -05:00
support_switch.ino Remove command SetOption62 2019-02-17 16:05:53 +01:00
support_wifi.ino Implement WifiConfig 7 2019-02-21 17:49:11 +01:00
user_config_override_sample.h Tiny typo fix in comment 2019-01-17 15:29:41 +01:00
xdrv_01_webserver.ino Fix command WebSend 2019-02-22 15:19:59 +01:00
xdrv_02_mqtt.ino Rules: Trigger Event with MQTT Subscriptions 2019-02-23 22:33:09 -05:00
xdrv_03_energy.ino Add user configuration of MCP39F501 2019-02-04 18:18:47 +01:00
xdrv_04_light.ino Make sleep for light scheme0 optional 2019-02-18 08:21:57 +02:00
xdrv_05_irremote.ino Fix IR local echo 2019-02-03 18:45:20 +01:00
xdrv_06_snfbridge.ino 6.4.1.16 Online template change 2019-02-11 19:21:49 +01:00
xdrv_07_domoticz.ino Update GUI 2019-02-13 16:05:25 +01:00
xdrv_08_serial_bridge.ino Update xdrv_08_serial_bridge.ino 2019-02-09 16:08:09 +01:00
xdrv_09_timers.ino Optimize RAM for expression 2019-02-19 14:49:15 +01:00
xdrv_10_rules.ino Rules: Trigger Event with MQTT Subscriptions 2019-02-23 22:33:09 -05:00
xdrv_11_knx.ino Update GUI 2019-02-13 16:05:25 +01:00
xdrv_12_home_assistant.ino 6.4.1.16 Online template change 2019-02-11 19:21:49 +01:00
xdrv_13_display.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xdrv_14_mp3.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xdrv_15_pca9685.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xdrv_16_tuyadimmer.ino 6.4.1.16 Online template change 2019-02-11 19:21:49 +01:00
xdrv_17_rcswitch.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xdrv_18_armtronix_dimmers.ino 6.4.1.16 Online template change 2019-02-11 19:21:49 +01:00
xdrv_19_ps16dz_dimmer.ino 6.4.1.16 Online template change 2019-02-11 19:21:49 +01:00
xdrv_99_debug.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xdrv_interface.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xdsp_01_lcd.ino Update xdsp_01_lcd.ino 2019-02-11 21:30:30 +01:00
xdsp_02_ssd1306.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xdsp_03_matrix.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xdsp_04_ili9341.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xdsp_05_epaper_29.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xdsp_interface.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xnrg_01_hlw8012.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xnrg_02_cse7766.ino Fix calibration calculation 2019-02-17 15:30:15 +01:00
xnrg_03_pzem004t.ino Fixes and Tuning 2019-02-05 12:21:31 +01:00
xnrg_04_mcp39f501.ino Fixes and Tuning 2019-02-05 12:21:31 +01:00
xnrg_05_pzem_ac.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xnrg_06_pzem_dc.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xnrg_interface.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xplg_wemohue.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xplg_ws2812.ino corrected sliding hour rounding for pixels < 60 2019-02-12 15:28:45 +01:00
xsns_01_counter.ino Update xsns_01_counter.ino 2019-02-18 11:06:16 +01:00
xsns_02_analog.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_04_snfsc.ino 6.4.1.16 Online template change 2019-02-11 19:21:49 +01:00
xsns_05_ds18b20.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_05_ds18x20.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_05_ds18x20_legacy.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_06_dht.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_07_sht1x.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_08_htu21.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_09_bmp.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_10_bh1750.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_11_veml6070.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_12_ads1115.ino ADS1115: Housekeeping 2019-02-07 19:09:49 +02:00
xsns_12_ads1115_i2cdev.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_13_ina219.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_14_sht3x.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_15_mhz19.ino Add MHZ19 Temperature to Domoticz 2019-02-08 13:00:11 +01:00
xsns_16_tsl2561.ino verify that tsl2561 works with new ads1115 2019-02-11 11:22:14 -07:00
xsns_17_senseair.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_18_pms5003.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_19_mgs.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_20_novasds.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_21_sgp30.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_22_sr04.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_23_sdm120.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_24_si1145.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_25_sdm630.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_26_lm75ad.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_27_apds9960.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_28_tm1638.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_29_mcp230xx.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_30_mpr121.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_31_ccs811.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_32_mpu6050.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_33_ds3231.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_34_hx711.ino Update GUI 2019-02-13 16:05:25 +01:00
xsns_35_tx20.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_36_mgc3130.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_37_rfsensor.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_38_az7798.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_39_max31855.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_40_pn532.ino Update xsns_40_pn532.ino 2019-02-08 15:35:28 +01:00
xsns_41_max44009.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
xsns_interface.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00
zzzz_debug.ino 6.4.1.12 code changes (byte/boolean) 2019-01-28 14:08:33 +01:00