MQTT and Thingspeak at the same time
Moderators: grovkillen, Stuntteam, TD-er
MQTT and Thingspeak at the same time
I would like to have both MQTT and Thingspeak support at the same time. Is it possible to make it via the rule engine?
//Peter
//Peter
Re: MQTT and Thingspeak at the same time
Like the idea 

- nonflammable
- Normal user
- Posts: 42
- Joined: 09 Mar 2016, 22:19
- Location: Poland
Re: MQTT and Thingspeak at the same time
i think it is possible temporarily with two esp8266 configured separately (first with MQTT, second with Thingspeak) and enabled synchronization between them 
or use SendToHTTP in rules eg.
SendToHTTP 184.106.153.149,80,/update.html?key=YOURKEY&field1=[your#value]

or use SendToHTTP in rules eg.
SendToHTTP 184.106.153.149,80,/update.html?key=YOURKEY&field1=[your#value]
Re: MQTT and Thingspeak at the same time
I don't see why you can not use Rules to send MQTT and the Thingspeak template. I used Domoticz HTTP template and MQTT via rules. I found it was not that reliable in an older version, R104 or R107 I think. The rules would sometimes send the first of the BME280 values and the other 2 would be "null". It worked perfect for a while then it stopped, no idea why. The new versions may work better, there is a newer version of PUBSUB.
My fix was to just switch to openHab MQTT and stopped using rules for sending MQTT. I don't use Thinkgspeak so I can't help there.
My fix was to just switch to openHab MQTT and stopped using rules for sending MQTT. I don't use Thinkgspeak so I can't help there.
Re: MQTT and Thingspeak at the same time
I cant get this to worknonflammable wrote: or use SendToHTTP in rules eg.
SendToHTTP 184.106.153.149,80,/update.html?key=YOURKEY&field1=[your#value]
SendToHTTP 184.106.153.149,80,/update.html?key=mykey&field1=[garaget#Humidity]
Nothing gets updated on Thingspeak, any suggestion?
i got this in the log
128939493 : EVENT: garaget#Humidity=68.00
- nonflammable
- Normal user
- Posts: 42
- Joined: 09 Mar 2016, 22:19
- Location: Poland
Re: MQTT and Thingspeak at the same time
http://www.esp8266.nu/index.php/Tutorial_Rulessonnyboy wrote: I cant get this to work
SendToHTTP 184.106.153.149,80,/update.html?key=mykey&field1=[garaget#Humidity]
Nothing gets updated on Thingspeak, any suggestion?
i got this in the log
128939493 : EVENT: garaget#Humidity=68.00
Code: Select all
On garaget#Humidity do
SendToHTTP 184.106.153.149,80,/update.html?key=mykey&field1=[garaget#Humidity]
endon
- nonflammable
- Normal user
- Posts: 42
- Joined: 09 Mar 2016, 22:19
- Location: Poland
Re: MQTT and Thingspeak at the same time
I cant get this to work. My friend petrho will test this this weekend.nonflammable wrote:Solved ?
Got no error in the log, but thingspeak doesent update.
Re: MQTT and Thingspeak at the same time
works fine here...
Re: MQTT and Thingspeak at the same time
But why cant I send multiple commands?
On System#Uptime do
SendToHTTP 184.106.153.149,80,/update.html?key=xxx&field1=[Temp_Hum#Temperature]
SendToHTTP 184.106.153.149,80,/update.html?key=xxx&field2=[Temp_Hum#Humidity]
SendToHTTP 184.106.153.149,80,/update.html?key=xxx&field3=[System#Uptime]
endon
only sent the first line...
On System#Uptime do
SendToHTTP 184.106.153.149,80,/update.html?key=xxx&field1=[Temp_Hum#Temperature]
SendToHTTP 184.106.153.149,80,/update.html?key=xxx&field2=[Temp_Hum#Humidity]
SendToHTTP 184.106.153.149,80,/update.html?key=xxx&field3=[System#Uptime]
endon
only sent the first line...
- nonflammable
- Normal user
- Posts: 42
- Joined: 09 Mar 2016, 22:19
- Location: Poland
Re: MQTT and Thingspeak at the same time
try to add empty line after "endon" and space before SendToHTTPpetrho wrote:But why cant I send multiple commands?
only sent the first line...

Code: Select all
On Clock#Time do
SendToHTTP 184.106.153.149,80,/update.html?key=xxx&field1=[Temp_Hum#Temperature]
SendToHTTP 184.106.153.149,80,/update.html?key=xxx&field2=[Temp_Hum#Humidity]
SendToHTTP 184.106.153.149,80,/update.html?key=xxx&field3=[System#Uptime]
endon
Re: MQTT and Thingspeak at the same time
Unfortunately same problem...nonflammable wrote:try to add empty line after "endon" and space before SendToHTTPpetrho wrote:But why cant I send multiple commands?
only sent the first line...
Code: Select all
On Clock#Time do SendToHTTP 184.106.153.149,80,/update.html?key=xxx&field1=[Temp_Hum#Temperature] SendToHTTP 184.106.153.149,80,/update.html?key=xxx&field2=[Temp_Hum#Humidity] SendToHTTP 184.106.153.149,80,/update.html?key=xxx&field3=[System#Uptime] endon
- nonflammable
- Normal user
- Posts: 42
- Joined: 09 Mar 2016, 22:19
- Location: Poland
Re: MQTT and Thingspeak at the same time
this should be okpetrho wrote: Unfortunately same problem...

Code: Select all
On Clock#Time do
SendToHTTP 184.106.153.149,80,/update.html?key=xxx&field1=[Temp_Hum#Temperature]&field2=[Temp_Hum#Humidity]&field3=[System#Uptime]
endon
Re: MQTT and Thingspeak at the same time
aha - you are right. Is it any delay command possible in the rule engine?nonflammable wrote:this should be okpetrho wrote: Unfortunately same problem...(Currently, a single channel can only be updated once every 15 seconds.)
Code: Select all
On Clock#Time do SendToHTTP 184.106.153.149,80,/update.html?key=xxx&field1=[Temp_Hum#Temperature]&field2=[Temp_Hum#Humidity]&field3=[System#Uptime] endon
- nonflammable
- Normal user
- Posts: 42
- Joined: 09 Mar 2016, 22:19
- Location: Poland
Re: MQTT and Thingspeak at the same time
Yespetrho wrote: aha - you are right. Is it any delay command possible in the rule engine?

Code: Select all
Delay <milliseconds>
Code: Select all
On Clock#Time do
SendToHTTP 184.106.153.149,80,/update.html?key=xxx&field1=[Temp_Hum#Temperature]&field2=[Temp_Hum#Humidity]&field3=[System#Uptime]
Delay 15000
SendToHTTP 184.106.153.149,80,/update.html?key=xxx&field1=[Temp_Hum#Temperature]&field2=[Temp_Hum#Humidity]&field3=[System#Uptime]
endon
http://www.esp8266.nu/index.php/ESPEasy ... _Reference
Who is online
Users browsing this forum: No registered users and 31 guests