schmupu/ioBroker.lupusec

Power Switch MQTT JSON Error

MacAgent opened this issue · 9 comments

Describe the bug
Since latest update to Adapter version 1.3.6 the Power Switch integration into MQTT is broken.
Switching On/Off from MQTT is working
Switching On/Off from Device or Lupusec App/Web via MQTT is not working.

To Reproduce
Steps to reproduce the behavior:

  1. Go to physical device and push the button
  2. Click on Lupusec XT2 (0.0.3.5R) WebApp on sesnor power switch
  3. Scroll down in Logs:

mqtt-client.0 | 2023-03-29 14:08:36.697 | debug | successfully published lupusec.0.devices.ZS:xxx001.status_ex: {"topic":"lupusec/0/devices/ZS:xxx001/status_ex","message":"true"}
mqtt-client.0 | 2023-03-29 14:08:36.696 | debug | publishing lupusec.0.devices.ZS:xxx001.status_ex

  1. See error in mosquitto.log

Screenshots & Logfiles
13:42:21.738 MQTT IN: lupusec/0/devices/ZS:xxx001/status_ex: false
13:42:21.739 Expanding json message
13:42:21.739 Error on JSON expansion: Inappropriate ioctl for device
13:42:21.739 All data filtered - skipping further processing of this message

Versions:

  • Adapter version: 1.3.6
  • JS-Controller version: 4.0.24
  • Node version: v18.15.0
  • Operating system: Linux iobroker 5.15.76-v7l+ #1596 SMP Mon Oct 31 17:11:33 GMT 2022 armv7l GNU/Linux

Additional context
none

greetings
Jacques

You have to set the ack flag to false in the MQTT payload. Please check if you send true/false as boolean and not as string.

Example:
onStateChange lupusec.0.devices.ZS:aXXXX.status_ex: {"val": true, "ack": false}
or
onStateChange lupusec.0.devices.ZS:aXXXX.status_ex: {"val": false, "ack": false}

image

Does it work now?

Hi,

I do not realy get the poitn here.
Where could I make this changes?
I cann still see this in IOBROKERS Log:
Object of state "lupusec.0.devices.ZS:9be001.status_ex" is missing the required property "common.type"

Where can I add this missing property?

Here is what I have

image

and this

image

image

Whar ever option I use, the mosquitto.log still show:

09:04:54.712 MQTT IN: lupusec/0/devices/ZS:9be001/status_ex: true
09:04:54.713 Expanding json message
09:04:54.713 Error on JSON expansion: Inappropriate ioctl for device
09:04:54.714 All data filtered - skipping further processing of this message

FYI: my setup

on a PI4 I have iobroker running beside of Loxberry 3.0.0.2
MQTT Server is part of the LB3.0 and communicating with a LOXONE Miniserver Gen.1
On iobroker the MQTT-Client and the Lupusec adapters and many others like Daikin, Shelly, Unifi etc... are installed
Many of them are configured to use mqtt-client.0 and everything is working as expected, except the Lupusec Power Switches.
All other Lupus devices are fine too. Like f.ex. the more complex configured Heating Valves.

Please advice where I should made this changes

Thanks

The Lupusec adapter or Lupuscec alarm system needs not an extra property with the name ack. It does not exsist.
If you change states in ioBroker, for example you want to set lupusec.0.devices.ZS:9be001.status_ex to the boolean value false. You can tell ioBroker to set the value with ack false or ack true. For the changing Lupusec Adapter states you must always set ioBroker states with ack false. You can change all ioBroker states for all iobroker adapters with *ack false/true.

If you change a value of a Lupusec adapter state in ioBroker by MQTT the payload of the MQTT Message has to be like this:
{"val": my_new_value, "ack": false}

for example, turn power on
lupusec.0.devices.ZS:aXXXX.status_ex = {"val": true, "ack": false}

for example, change the name of the socket to "socket kitchen"
lupusec.0.devices.ZS:aXXXX.name = {"val": "socket kitchen", "ack": false}

It is not an error in the Lupuscec adapter. I checked it with MQTT (see screenshots) and it works great with MQTT.

Hello, (back from holiday)

I'm sorry, but I do not realy understand where I have to change this values!

I deleted the whole Lupusec Object Tree and removed and reinstalled the Lupusec Adapter.
All my Lupusec Door and Windows and Motion sensors are working again, but when I push the button on a Power Switch I still see this error in the mqttgateway.log

09:10:58.258 MQTT IN: lupusec/0/devices/ZS:9be001/status_ex: true
09:10:58.259 Expanding json message
09:10:58.259 Error on JSON expansion: Inappropriate ioctl for device
09:10:58.260 All data filtered - skipping further processing of this message

This is working
image

Power Off
lupusec/0/devices/ZS:9be001/status_ex = 0
Power On
lupusec/0/devices/ZS:9be001/status_ex = 1

this was working for the last few years and is still working with MQTT-Explorer

What and where do I have to make this changes to get it working again?

You do not have to install the MQTT or Lupusec adapter new. They are totally okay!
If you want to set (publish) the state bei MQTT, you have to send (publish) the JSON {"val": true, "ack": false} and not 1 or true to turn the power on.
In your screenshot, you are sending 1 or 0 instead of {"val": true, "ack": false} or {"val": false, "ack": false}

Setting (publishing) state by MQTT (for example with MQTT-Explorer)
correct:

lupusec/0/devices/ZS:9be001/status_ex = {"val": true, "ack": false}
lupusec/0/devices/ZS:9be001/status_ex = {"val": fasle, "ack": false}

incorrect

lupusec/0/devices/ZS:9be001/status_ex = 1
lupusec/0/devices/ZS:9be001/status_ex = 0
lupusec/0/devices/ZS:9be001/status_ex = true
lupusec/0/devices/ZS:9be001/status_ex = false
lupusec/0/devices/ZS:9be001/status_ex = "true"
lupusec/0/devices/ZS:9be001/status_ex = "false"

if you receive the sates in MQTT (for example in MQTT Explorer), you will get the states true or false for lupusec/0/devices/ZS:9be001/status_ex back in MQTT Explorer. It is a litte bit confusing, that states look different for receiving and sending states.

Wenn ich Dich richtig verstehe, bekommst Du keinen Fehler in ioBroker angezeigt? Das Logfile sieht gut aus?
Welche Anwendung gibt Dir genau den Fehler? Mosquitto.?

Hallo,

Doch ich sehe im iobroker Log folgendes: Object of state "lupusec.0.devices.ZS:9be001.status_ex" is missing the required property "common.type"
Und die JSON Fehler sehe ich danach im /opt/loxberry/log/system_tmpfs/mqttgateway.log

Um das zusätzlich noch zu Erwähnen: Das schalten des Schalter funktioniert sehr wohl auch mit

lupusec/0/devices/ZS:9be001/status_ex = {"val": true, "ack": false}
lupusec/0/devices/ZS:9be001/status_ex = {"val": false, "ack": false}
und mit
lupusec/0/devices/ZS:9be001/status_ex = 1
lupusec/0/devices/ZS:9be001/status_ex = 0
lupusec/0/devices/ZS:9be001/status_ex = true
lupusec/0/devices/ZS:9be001/status_ex = false
lupusec/0/devices/ZS:9be001/status_ex = "true"
lupusec/0/devices/ZS:9be001/status_ex = "false"

Nur wenn ich den Schalter am Power Switch selbst betätige, bekomme ich nach dem nächsten Pollen im iobroker Log und im Mosquitto Log die genannten Fehler.

Mein MQTT Server ist der von LOXBERRY 3.0 integrierte und Iobroker läuft auf dem gleichen PI4. Auf dem iobroker ist nur der MQTT Client Adapter installiert. Und wie gesagt, ich habe nur die aller nötigste Konfiguration vorgenommen. Also MQTT Server, Port, Username, Password.
Im Lupusec Objekt lupusec/0/devices/ZS:9be001/status_ex MQTT Enbled
Das sieht man ob im Screenshot.

Ich bin bis jetzt davon ausgegangen, dass bis vor dem letzten Lupusec Adapter Update alles reibungslos funktionierte.
Da bin ich mir aber heute nicht mehr so ganz sicher, denn eine Woche vorher hatte ich auch von Loxberry 2 auf 3 upgegraded, und natürlich habe ich danach nicht alle Funktionen bis ins kleinste Detail überprüft. Mir ist erst nach dem Lupusec Adapter update aufgefallen, dass es nicht mehr funktioniert, es könnte aber auch durchaus sein dass nach LB3.0 Update nicht mehr funktioniert hat und es mir nur nicht aufgefallen ist.

Also Sorry für das Durcheinander.

VG