Commit Graph

55 Commits

Author SHA1 Message Date
Theo Arends 148192b80d Attempt to fix MQTT reconnects
Attempt to fix MQTT reconnects
2019-04-06 13:39:59 +02:00
Theo Arends 880bbe357d Change String to char
Change String to char
2019-03-31 17:57:28 +02:00
Theo Arends 8d8e060550 Revert "Test for easier MQTT reconnects"
This reverts commit b7adb10923.
2019-03-31 17:55:58 +02:00
Theo Arends b7adb10923 Test for easier MQTT reconnects
Test for easier MQTT reconnects
2019-03-31 17:51:05 +02:00
Theo Arends f7c30250c1 Change some more defines to const
Change some more defines to const
2019-03-31 11:59:04 +02:00
Theo Arends 929292f7a8 Update xdrv_02_mqtt.ino
Restore MQTT attempting connection message
2019-03-30 16:32:22 +01:00
Theo Arends 2aad0567bf Change some defines to const
Change some defines to const
2019-03-30 16:29:27 +01:00
Theo Arends eb9617e3f9 Tune some functionality
Tune some functionality
2019-03-30 13:03:45 +01:00
Theo Arends e1c92b701b Change NULL to nullptr
Change NULL to nullptr
2019-03-26 18:26:50 +01:00
Theo Arends 57cb570b8f Fix GUI corruption
Fix GUI corruption due to format string usage (#5519)
2019-03-25 11:20:03 +01:00
Theo Arends 6922e657d9 Shrink code/flash space
Shrink code/flash space
2019-03-23 17:00:59 +01:00
Theo Arends 99d20f803b More web chunks
More web chunks
2019-03-16 16:23:41 +01:00
Theo Arends ca5c3d1eeb 6.4.2.22 Remove support for MQTT_LIBRARY_TYPE
6.4.2.22 20190315
 * Remove support for MQTT_LIBRARY_TYPE, MQTT_ARDUINOMQTT and MQTT_TASMOTAMQTT (#5474)
2019-03-15 14:29:47 +01:00
Theo Arends baa5825569 Free some flash
Free some flash
2019-03-11 10:38:41 +01:00
Theo Arends d0ac200a78 Replace webserver flash string to char
Replace webserver flash string to char
2019-03-10 15:36:34 +01:00
Laurent Dong b87afc3bcb Code review: Copy string with strlcpy() instead of snprintf()
Copying string with snprintf() is unsafy and slow because it check and replace plcaehold (%?)
2019-03-08 13:24:02 -05:00
Theo Arends 06a9fbd792 Changed logging message handling
Changed logging message handling
2019-03-08 15:15:42 +01:00
Theo Arends 58fe50d81a Update webserver layout
Update webserver layout
2019-03-07 18:18:30 +01:00
Theo Arends b393cdc9f1 Replace menu button list
Replace menu button list
2019-03-04 18:32:23 +01:00
Theo Arends d790b1cfca 6.4.1.20 Webserver uses chunks
6.4.1.20 20190304
 * Changed webserver content handling from single String to small Chunks increasing RAM
2019-03-04 18:16:07 +01:00
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
Theo Arends 4884a94b6d Add LinkCount and MqttCount
* Add property LinkCount to state and status 11 message representing number of Wifi Link re-connections
 * Add property MqttCount to status 6 message representing number of Mqtt re-connections
2019-02-18 17:05:25 +01:00
Jason 10bdb7c975 mqtt password GUI aligned to revised wifi version 2019-02-17 18:45:58 +00:00
Theo Arends c39e2da6b5 Update GUI
Update GUI
2019-02-13 16:05:25 +01:00
Theo Arends 98ae3eaf54 6.4.1.16 Online template change
6.4.1.16 20190211
 * Initial support for online template change using command Template (#5177)
2019-02-11 19:21:49 +01:00
Theo Arends 3a59084377 Enable group status messages
Add status message to former declined group commands (#5145)
2019-02-09 13:37:27 +01:00
Theo Arends 304ac6fe44 6.4.1.12 code changes (byte/boolean)
6.4.1.12 20190128
 * Change code use of boolean to bool and byte to uint8_t
 * Change code uint8_t flags to bool flags
2019-01-28 14:08:33 +01:00
Theo Arends 2b7fbe22e3 Fix MQTT host detection
Fix MQTT host detection
2019-01-20 16:57:07 +01:00
Mike c963900709 If the MDNS hostname is set, use it to verify the cert name. 2019-01-17 19:09:58 -08:00
Mike 838b113fa3 Add a define for mDNS hostname to connect to for MQTT. 2019-01-15 21:48:07 -08:00
Mike 5e06ae1d81 Do MDNS even if TLS is enabled.
I imagine this was disabled due to memory issues, but this seems to work
fine on a Sonoff Basic.
2019-01-15 18:08:28 -08:00
Mike d2d07543b2 Do an MDNS resolve before using the cached host.
MDNS shouldn't be aggressively cached, since the IP could change. This
makes using DHCP for the host a lot easier.
2019-01-15 17:26:51 -08:00
Theo Arends 2e101839a4 Change web authentication
Change web authentication (#4865)
2019-01-10 12:57:42 +01:00
Theo Arends 447ec6256e 6.4.1.4 Update Copyright (C) 2019
6.4.1.4 20190101
 * Update Copyright (C) 2019
2019-01-01 13:55:01 +01:00
Theo Arends afe83a3460 Prep for template tuning 2018-12-29 17:19:13 +01:00
Theo Arends 0539775cf0 Change MQTT GUI password handling
Change MQTT GUI password handling (#4723)
2018-12-24 14:31:34 +01:00
Theo Arends 77c07a2e00 Change FallbackTopic
Change FallbackTopic from cmnd/<mqttclient>/ to cmnd/<mqttclient>_fb/ to discriminate from Topic (#1528)
2018-12-23 14:48:57 +01:00
Theo Arends ed6e411f7f Add optional TLS_CA_CERT
Add define USE_MQTT_TLS_CA_CERT for checking MQTT TLS against root ca using Let's Encrypt cert from sonoff_letsencrypt.h - not supported with core 2.3.0 (#4703)
2018-12-22 18:09:27 +01:00
Frank Meies d722387344 Check for core version when enabling tls ca cert
Signed-off-by: Frank Meies <19324766+fmeies@users.noreply.github.com>
2018-12-21 22:49:46 +01:00
Frank Meies 435b3afde7 Added option for checking mqtt tls against root ca
Signed-off-by: Frank Meies <19324766+fmeies@users.noreply.github.com>
2018-12-21 11:28:47 +01:00
Theo Arends 9a3c3895fb Fix Domoticz Fanspeed
Fix Domoticz Fanspeed
2018-12-06 15:03:42 +01:00
Theo Arends dfa0d2ef11 Add Domoticz Selector for Fanspeed
Add support for iFan02 Fanspeed in Domoticz using a selector (#4517)
2018-12-06 10:49:49 +01:00
Theo Arends 263839a1a0 Fix MqttRetry values above 255
Fix MqttRetry values above 255 seconds (#4424)
2018-11-24 12:01:13 +01:00
Theo Arends 6c87ab205a Fix possible strncat buffer overflows
Fix possible strncat buffer overflows
2018-11-22 15:41:30 +01:00
Theo Arends 23c16e58a9 Housekeeping
Housekeeping
2018-11-20 15:00:24 +01:00
Theo Arends 4899178362 6.3.0.10 Add command SetOption36
6.3.0.10 20181118
 * Add command SetOption36 0..255 milliseconds (10 default) to tune main loop dynamic delay
2018-11-18 16:49:02 +01:00
andrethomas 4a7e7b0dbb Change C functions with () to (void) 2018-11-14 15:32:09 +02:00
Theo Arends c75ae78d88 6.3.0.5 Add code image
6.3.0.5 20181107
 * Add code image and optional commit number to version
2018-11-07 15:03:41 +01:00
Theo Arends 9fef82736d Prep drivers for management
Prep drivers for management
2018-11-07 10:30:03 +01:00
Theo Arends 5c78561b07 6.2.1.20 Add mDNS delay option
6.2.1.20 20181028
 * Add command SetOption35 0..255 (seconds) to delay mDNS initialization to control possible Wifi connect problems
2018-10-28 17:57:25 +01:00