MQTT initial configuration: "Custom on/open value" bug / issue?

  • Platform information:

    • Hardware: x86/16GB RAM/240GB
    • OS: Official 3.0.0 Docker image running in Ubuntu 20.04
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version: 3.0.0
  • Issue of the topic: I have several Shellies in my apartment for switching lights / extractor fans. All Shellies are running the latest firmware. I use the Shelly binding to control them from openHAB, but because of my router (I think), the CoAP events aren’t arriving in real time, so I’m using MQTT to get the events.
    I’m up and running now, so this is more of a curiosity than anything, but I think I encountered a bug when setting up the MQTT channels for the first time - MQTT events were not working until I edited (back to the same value) the ‘Custom on/open value’ and ‘Custom off/closed value’ in the channel configuration, and then saved the Thing.

To replicate:

  1. Create a fresh channel for an MQTT Thing, as an On/Off Switch.
  2. Set up MQTT State Topic - don’t touch anything else, the defaults look good
  3. Save Thing
  4. Test device - not updating in openHAB
  5. Verify device is broadcasting on that topic by checking Mosquitto - confirmed good
  6. Edit channel, delete and re-type 1 and 0 in ‘Custom On/Open Value’ and ‘Custom Off/Closed Value’
  7. Save Thing and test - working as expected!

Has anyone else seen this? Or is it just a weird quirk of my setup / I did something stupid?

I initially troubleshot it by creating another channel as plain text, to check openHAB was seeing the messages, which it was, which eventually led me to the fix. It’s a weird one, so hopefully this post helps someone with the workaround if nothing else…

P.S. If anyone has any tips about why the CoAP events aren’t arriving, I’m open to any suggestions (even how I can monitor / check where the issue lies).

I recognised this from another user, but it’s slightly different. Perhaps the same cause?

I can confirm that’s the same bug I encountered. But with my tests I did not get it running by deleting and re-typing it (Firefox 84.0.2 (64-Bit)), I had to enter the values in the “CODE”-section.

Good news that I’m not alone!

The fix proposed in Github looks like it will work, so I think enough said on this. Hopefully anyone struggling with this issue until then finds the bug report or this post, and can get things working until the fix is merged.

Can You please inform me what I have to put there?
json of sensor gives: “occupancy”: true
ChannelType: ON/Off switch, Kontact or trigger ?
‘Custom On/Open Value’: 1, ON or true, or list 1,ON,true
LinkedItemType: ON/Off switch, Kontact or trigger ?
Thanks in advance for solution.
Piet

Start with that, it’s your choice.
Trigger channels are the less usual way to work with steady-state data.

Have you looked ar any examples,like -