MxMQTT Subscriber from piet66 | Control a switch

Discussions about Z-Way software and Z-Wave technology in general
piet66
Posts: 266
Joined: 04 Feb 2017 17:00

Re: MxMQTT Subscriber from piet66 | Control a switch

Post by piet66 »

Hi Heinrich,
EnricoC wrote:
03 Jun 2023 16:37
TypeError: undefined is not a function
I can't reproduce this. For analysis, I would need a new log without that socket issues.
Operable widgets
Clicking on the icon means that ZWay will request an update from the device. This doesn't work for virtual devices fed via MQTT.
If I switch the device in the zway GUI with the buttons, everthings works as expected. The dot behind the name switches to blue and then back to black.
The colors mean:
green: value was received from the broker and is marked as 'acknowledged' (acknowledge-key=true)
yellow: value was received from the broker and is marked as 'not (yet) acknowledged' (may not be supported by every sender, ioBroker does)
blue: input by user
red: error
black: no match, received value wasn't found in the list of allowed values.

In your case, your input was sent to the broker, the app has received an answer, but it couldn't find the received value in the list of allowed values. You should check your parameters (Format: off-value:on-value)
(Switching the device in the mobile view is not working)
What do you mean with mobile view?
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me ZW0700 7.20.00 07.38/1766938484 1025/257
Z-Way version v3.2.3 from 2022-04-06 04:56:23 +0300
EnricoC
Posts: 6
Joined: 18 Jan 2023 18:56

Re: MxMQTT Subscriber from piet66 | Control a switch

Post by EnricoC »

Dear piet66,

I have no more ideas to configure your module correct. I tried as well the user defined as well the standard configuration, but with no success. Could you give me a hint?

That's the configs from the switches, one user defined and one on/off switch. Both do not work properly. Sending state changes works but black dot for "Stecker 1" and red dot for "Gartenwasser".


{
"Topic": "zigbee2mqtt/(S) Stecker1",
"deviceTitle": "Stecker 1",
"icon": "../../../../../../smarthome/storage/img/icons/switch-on.png",
"conditionalIcon": "valueObj.state === 'OFF' ? \"../../../../../../smarthome/storage/img/icons/switch-off.png\" : \"../../../../../../smarthome/storage/img/icons/switch-on.png\"",
"writeAccess": true,
"deviceType": "userswitch",
"userswitchValues": "OFF:ON"
},
{
"Topic": "zigbee2mqtt/GartenWasser",
"deviceTitle": "Gartenwasser",
"icon": "../../../../../../smarthome/storage/img/icons/switch-on.png",
"conditionalIcon": "valueObj.state === 'OFF' ? '../../../../../../smarthome/storage/img/icons/switch-off.png' : '../../../../../../smarthome/storage/img/icons/switch-on.png'",
"writeAccess": true,
"deviceType": "switch"
}
piet66
Posts: 266
Joined: 04 Feb 2017 17:00

Re: MxMQTT Subscriber from piet66 | Control a switch

Post by piet66 »

"icon": "../../../../../../smarthome/storage/img/icons/switch-on.png",
"conditionalIcon": "valueObj.state === 'OFF' ? \"../../../../../../smarthome/storage/img/icons/switch-off.png\" : \"../../../../../../smarthome/storage/img/icons/switch-on.png\"",
For standard ZWay icons you can write this instead:
  • "icon": "switch-on",
  • "conditionalIcon": " level === 'off' ? 'switch-off' : 'icon' ",
{
"Topic": "zigbee2mqtt/GartenWasser",
"deviceTitle": "Gartenwasser",
"icon": "../../../../../../smarthome/storage/img/icons/switch-on.png",
"conditionalIcon": "valueObj.state === 'OFF' ? '../../../../../../smarthome/storage/img/icons/switch-off.png' : '../../../../../../smarthome/storage/img/icons/switch-on.png'",
"writeAccess": true,
"deviceType": "switch"
}
This doesn't work if the broker sends OFF and ON. ZWay switches require off and on. You should get an error message "value 'OFF' is not a switching variable!". Use deviceType userswitch.
{
"Topic": "zigbee2mqtt/(S) Stecker1",
"deviceTitle": "Stecker 1",
"icon": "../../../../../../smarthome/storage/img/icons/switch-on.png",
"conditionalIcon": "valueObj.state === 'OFF' ? \"../../../../../../smarthome/storage/img/icons/switch-off.png\" : \"../../../../../../smarthome/storage/img/icons/switch-on.png\"",
"writeAccess": true,
"deviceType": "userswitch",
"userswitchValues": "OFF:ON"
},
This should work, if the MQTT broker sends OFF and ON. The app has to convert it to off and on.

In next verion 1.2.6 I add more log messages for better analysis, besides some corrections.
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me ZW0700 7.20.00 07.38/1766938484 1025/257
Z-Way version v3.2.3 from 2022-04-06 04:56:23 +0300
Post Reply