Page 19 of 19

Re: [90] MQTT Support

Posted: Tuesday 27 October 2020 12:15
by MeAlbert
I have a now and then problem left. I get the following message:
27-10-2020 12:04:32node: dc3574e1.4bac9msg : string[41]
"Unexpected token W in JSON at position 16"
27-10-2020 12:04:32node: 5627d816.529848
domoticz/out : msg.payload : Object
{ command: "udevice", idx: 86, svalue: "232W" }
The svalue is 232W and that's not correct and I get an error message.

The strange thing is that suddenly the W error disappears and I get a C error in a temperature device. The input from MQTT is:
domoticz/out : msg.payload : Object
object
Battery: 255
EnergyMeterMode: "0"
RSSI: 12
description: ""
dtype: "General"
hwid: "11"
id: "000B0004"
idx: 86
name: "PV Vermogen Garage"
nvalue: 0
stype: "kWh"
svalue1: "200W"
svalue2: "1300400.0"
unit: 4
It looks that the mistake already starts when domoticz is making the mqtt/out message. Any idea what I can do about it?

Re: [90] MQTT Support

Posted: Monday 29 November 2021 21:40
by dbrb2
Evening,
I have a strange MQTT problem:

I have a wifi dimmer running Tasmota
It is autoDiscovered by Domoticz fine, appearing as a switch with a dimmer slider.

From the domoticz UI, I can set the brightness level, and the dimmer responds. In response, the Domoticz UI updates to match reality.
However, if I toggle the switch from the Domoticz UI, though the light responds, turning OFF / ON as requested, the Domoticz UI does not update

I can only assume that some MQTT response that is expected has not been seen:

Switching the dimmer on using the Domoticz UI icon does indeed turn the light on - but the UI does not change - it still thinks it is off.

Taken from the device logs:

Code: Select all

00:17:49.466 MQT: tele/bedroom_light/SENSOR = {"Time":"2021-11-30T00:17:49","COUNTER":{"C1":0}}
00:17:50.452 SRC: MQTT
00:17:50.454 CMD: Grp 0, Cmnd 'POWER', Idx 1, Len 2, Data 'ON'
00:17:50.468 MQT: tele/bedroom_light/STATE = {"Time":"2021-11-30T00:17:50","Uptime":"0T01:10:10","UptimeSec":4210,"Heap":23,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":19,"MqttCount":1,"POWER":"ON","Dimmer":44,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"barkernet","BSSId":"78:65:59:7C:9E:47","Channel":6,"Mode":"11n","RSSI":100,"Signal":-50,"LinkCount":1,"Downtime":"0T00:00:03"}}
00:17:50.474 MQT: stat/bedroom_light/RESULT = {"POWER":"ON"}
00:17:50.476 MQT: stat/bedroom_light/POWER = ON
00:17:50.488 MQT: tele/bedroom_light/HASS_STATE = {"Version":"10.0.0(tasmota)","BuildDateTime":"2021-11-29T22:05:54","Module or Template":"WiFi-Dimmer","RestartReason":"Software/System restart","Uptime":"0T01:10:10","Hostname":"bedroom-light-6487","IPAddress":"192.168.1.23","RSSI":"100","Signal (dBm)":"-50","WiFi LinkCount":1,"WiFi Downtime":"0T00:00:03","MqttCount":1,"LoadAvg":19}
00:17:50.558 CFG: Saved to flash at FB, Count 1444, Bytes 4096
The Domoticz logs for the same event show:

Code: Select all

2021-11-29 23:16:28.635 MQTT: onMQTTPublish: tele/bedroom_light/STATE:b'{"Time":"2021-11-30T00:16:28","Uptime":"0T01:08:48","UptimeSec":4128,"Heap":23,"SleepMode":"Dynamic","Sleep":10,"LoadAvg":32,"MqttCount":1,"POWER":"ON","Dimmer":45,"Fade":"OFF","Speed":1,"LedTable":"ON","Wifi":{"AP":1,"SSId":"barkernet","BSSId":"78:65:59:7C:9E:47","Channel":6,"Mode":"11n","RSSI":100,"Signal":-50,"LinkCount":1,"Downtime":"0T00:00:03"}}'
2021-11-29 23:16:28.635 MQTT: getDevices key: '' configkey: '' hasconfigkey: '' value: '' config: '' topic: 'tele/bedroom_light/STATE'
2021-11-29 23:16:28.636 MQTT: getDevices found 1 devices
2021-11-29 23:16:28.636 MQTT: Got state_topic
2021-11-29 23:16:28.636 MQTT: No value_template
2021-11-29 23:16:28.636 MQTT: nValue: '0'
2021-11-29 23:16:28.636 MQTT: Got brightness_state_topic
2021-11-29 23:16:28.637 MQTT: brightness_value_template: 'Dimmer'
2021-11-29 23:16:28.637 MQTT: message[brightness_value_template]: '45'
2021-11-29 23:16:28.506 Status: User: Admin (IP: 192.168.1.154) initiated a switch command (2659/MQTT - Bedroom light/On)
Could the issue be related to the "no value_template" line...?

Cheers!

Re: [90] MQTT Support

Posted: Friday 18 February 2022 16:16
by smitex
Hello,
can someone help me to import data from Mqtt to Domoticz.
I want to import data to a specific IDX.
I made a screenshot of MQTT Explorer, but can't figure out how to import these values.

so:
Input to an IDX
Output to an IDX
Flow to an IDX
Watt to an IDX
I want to do it with a Node-RED sequence (flow)
any help would be appreciate
Thanks, Peter

Re: [90] MQTT Support

Posted: Friday 18 February 2022 17:34
by waltervl
smitex wrote: Friday 18 February 2022 16:16 Hello,
can someone help me to import data from Mqtt to Domoticz.

I want to do it with a Node-RED sequence (flow)
any help would be appreciate
Thanks, Peter
You better create a new topic in the Node-red sub topic to get better help viewforum.php?f=81

Re: [90] MQTT Support

Posted: Friday 18 February 2022 18:37
by FireWizard
Hello @smitex,

I do not understand, why you raise this issue again at this forum this afternoon.
It has been answered yesterday.Do not post the same issue at multiple forums.

See: https://discourse.nodered.org/t/mqtt-da ... -idx/58476

Regards

Re: [90] MQTT Support

Posted: Friday 18 February 2022 19:08
by smitex
Oh, sorry FireWizard,

I did not jet see you post, thank you very much for you repley,
I will test you nodered flow👍👌

Re: [90] MQTT Support

Posted: Tuesday 15 March 2022 11:55
by mjchrist
In response to the Domoticz WIKI "MQTT - Arduino, Needed! Please Help." I use the sketch (Arduino) which you can find in the forum at:

viewtopic.php?t=38155

The advantage of the sketch is that you only need Mosquitto as a broker and that NodeRED does not have to be installed.

Re: [90] MQTT Support

Posted: Monday 03 July 2023 22:13
by Paulus
Hi,

I'm not sure if this question already is answered (I couldn't find it at least).
Is it possible to update multiple sensors in one message (MQTT > Domoticz)?

Kr, Paul

Re: [90] MQTT Support

Posted: Monday 03 July 2023 22:50
by FireWizard
Hello @Paulus,

To answer your question.

No this is not possible.

In one MQTT message you can only address one idx number and so you can update only one sensor.

See the Wiki: https://www.domoticz.com/wiki/MQTT and specific the chapter MQTT to Domoticz.

Regards

Re: [90] MQTT Support

Posted: Friday 15 December 2023 20:12
by niki_lauda
dbrb2 wrote: Monday 29 November 2021 21:40 Evening,
I have a strange MQTT problem:

I have a wifi dimmer running Tasmota
It is autoDiscovered by Domoticz fine, appearing as a switch with a dimmer slider.

From the domoticz UI, I can set the brightness level, and the dimmer responds. In response, the Domoticz UI updates to match reality.
However, if I toggle the switch from the Domoticz UI, though the light responds, turning OFF / ON as requested, the Domoticz UI does not update

I can only assume that some MQTT response that is expected has not been seen:

Switching the dimmer on using the Domoticz UI icon does indeed turn the light on - but the UI does not change - it still thinks it is off.


Cheers!
However, if I toggle the switch from the Domoticz UI, though the light responds, turning OFF / ON as requested, the Domoticz UI does not update
Did you resolve this issue?
I am experincing the same, lights are switching on. In the log the switch is on but in the ui it stays off. Restart of domoticz an the ui is updated.
I am on 2023.2.

Re: [90] MQTT Support

Posted: Saturday 16 December 2023 18:28
by FlyingDomotic
Paulus wrote: Monday 03 July 2023 22:13 Hi,

I'm not sure if this question already is answered (I couldn't find it at least).
Is it possible to update multiple sensors in one message (MQTT > Domoticz)?

Kr, Paul
You may try https://github.com/FlyingDomotic/domoti ... per-plugin. You may use multiple topics on the same device and/or multiple devices on the same topic, and ... more!

And if some functions are missing, don't hesitate to ask for ;-)