hi,
I’ve got this device
Moes MOES_plug control via MQTT | Zigbee2MQTT
Exposes
Switch
The current state of this switch is in the published state under the state
property (value is ON
or OFF
). To control this switch publish a message to topic zigbee2mqtt/FRIENDLY_NAME/set
with payload {"state": "ON"}
, {"state": "OFF"}
or {"state": "TOGGLE"}
. To read the current state of this switch publish a message to topic zigbee2mqtt/FRIENDLY_NAME/get
with payload {"state": ""}
.
It seems it exposes a switch as a string item (as it can receive TOGGLE command, not just ON/OFF)
So I’ve created a String Thing, and a String item, and everything works (tested by sending commands ON OFF TOGGLE to it in karaf).
I’ve cheated my way through sitemap by adding a Switch Item to a sitemap (pointing to a item name that is actually a String). I’m surprised this even worked
But now a problem I have is, while everything is fine on the sitemap, but MainUI of course cannot switch a string. I am using semantic hierarchy, so my MainUI got populated automatically, and I have a string amongst switches.
First of all, it seems impractical to have a smart plug that does not produce a switch item, just unnecessary complication. But cannot complain much as these plugs are nice and small and go for 10 euros on aliexpress
Is there any elegant way to solve this, other than creating a proxy switch, and having rules handle the switching of the switch?
Am I overseeing something obvious? I tried changing the item and thing from string to switch but it doesnt work…
EDIT: Also, I added this item to some lights group switch, but it doesn’t get switched off with a group OFF because its not a switch…
EDIT2: could I utilize a follow profile for this dummy switch to follow the state of the string item and vice versa?