Unknown status for Shelly H&T Sensor after reboot

  • Platform information:
    • Hardware: RPI 3b
    • OS: Openhabian
    • Java Runtime Environment:
      OpenJDK Runtime Environment (Zulu8.40.0.178-CA-linux_aarch32hf)
      openjdk version “1.8.0_222”
    • openHAB version: openHAB 2.5.1-2 (Release Build)

I tried to integrate Shelly H&T Sensors in OH2 via Shelly binding but everything works until I restart the system (reboot). Firstly I follow the Shelly Binding documentation and I have defined “manually” the things/items or via Paper UI. In both cases, I go to the “Unknown” state of the ShellyThing after a system reboot. You can find below my thing/item conf file:

Thing shelly:shellyht:F2B670 “ShellyBirouri” @ “Zona Birouri” [ deviceIp=“”, userId=“admin”, password=“mqttbroker20”, lowBattery=15 , eventsCoIoT=true ]
Thing shelly:shellyht:F2B672 “ShellyFerolli” @ “Birou Ferolli” [ deviceIp=“”, userId=“admin”, password=“mqttbroker20”, lowBattery=15 , eventsCoIoT=true ]

// Items
Number ShellyHT_Ferolli_Temp {channel=“shelly:shellyht:F2B672:sensors#temperature”} //F2B672 sensor ID
Number ShellyHT_Ferolli_Humid {channel=“shelly:shellyht:F2B672:sensors#humidity”}
Number ShellyHT_Ferolli_Batt {channel=“shelly:shellyht:F2B672:battery#batteryLevel”}

// Sitemap:
sitemap hvac label=“Incalzire”
Frame label=“Temperaturi” {
Text item=ShellyHT_Ferolli_Temp label=“Temp. Ferolli [%.1f °C]”
Text item=ShellyHT_Ferolli_Humid label=“Um. Ferolli [%d]”
Text item=ShellyHT_Ferolli_Batt label=“Baterie Ferolli [%d %%]”

I want to add here that I got in the log file the message that I should update the firmware of sensor to version 1.5.2 or newer but in the sensor WEB GUI I found that the sensor has the latest firmware version and of course I’m not able to perform an update…
The current firmware version of the sensor: /20181128-144724()

Please let me know if I miss something or maybe is a known issue…

Thank you!

Of course you read the OH documents that unless you have persistence set up, Items have a null state.
Was there something else that made this unexpected? Perhaps some persistence configuration issue?

Thank you for your prompt response. Maybe I was not so precise with my explanation. The "unknown state: is not for Items is for the Shelly Sensors Things that as I know it’s not possible to configure in the persistence…
Message that I received on log file after restart:

2020-02-29 17:02:03.793 [hingStatusInfoChangedEvent] - ‘shelly:shellyht:f2b672’ changed from UNINITIALIZED to INITIALIZING

2020-02-29 17:02:03.825 [hingStatusInfoChangedEvent] - ‘shelly:shellyht:f2b670’ changed from UNINITIALIZED to INITIALIZING

Maybe I’m wrong…

If the password in the OP is the one you use you may want to edit that out.

Have you created the Thing in both PaperUI and files? If you please check that you do not have duplicates as this will cause issues. You will need to configure your Thing in one place only.

Thank you for your remarks/tips

The password and user ID that I configure in the sensor WEB API (Internet & Security - > RESTRICT LOGIN ) I’m using inside of Shelly Binding Configuration and also for ShellyThings.

I tried first to use only the configuration file (*.thing / *.items) and after that I had been removed the files and tried to use exclusively the Paper UI.
Unfortunately I got the same result…

As you can see below I was able to get the status of the Shelly thing Online and also I received the temp values :

2020-02-29 16:59:09.151 [hingStatusInfoChangedEvent] - ‘shelly:shellyht:f2b672’ changed from UNKNOWN to ONLINE

2020-02-29 16:59:09.153 [hingStatusInfoChangedEvent] - ‘shelly:shellyht:f2b670’ changed from UNKNOWN to ONLINE

2020-02-29 16:59:09.248 [vent.ItemStateChangedEvent] - Shellyht_Temp_Birouri changed from NULL to 25.00 °C

2020-02-29 16:59:09.250 [vent.ItemStateChangedEvent] - Shellyht_Temp_Ferolli changed from NULL to 24.90 °C

2020-02-29 16:59:11.339 [vent.ItemStateChangedEvent] - Shellyht_Temp_Ferolli changed from 24.90 °C to 24.88 °C

2020-02-29 17:00:32.358 [me.event.ThingUpdatedEvent] - Thing ‘shelly:shellyht:f2b672’ has been updated.

What do you think is wrong in the log you have shown? Things would be expected to start off uninitialized at system boot time. Once the remote device communicates, the Thing status would change. Items would be expected to start off as NULL after a reboot. Once the remote device communicates, data will be available to update them.

Would you show this message, it’s not clear where that comes from. Binding I expect.

The problem is that it’s it’s remaining in “Unknown state” and it will not communicate with the sensors.

Regarding the firmware update message It’s related to Shelly binding. you can find below the compleate message:

2020-02-29 18:40:32.777 [WARN ] [y.internal.handler.ShellyBaseHandler] - shellyht-f2b670: WARNING: Firmware might be too old (or beta release), installed: /20181128-144724 (), required minimal v1.5.2. The binding was tested with version 1.50+ only. Older versions might work, but do not support all features or show technical issues. Please consider upgrading to v1.5.0 or newer!

I found an workaround to get the online state after a system restart.
if I will restart the OH2 service (systemctl restart openhab2.service) it seems that the state of the shellything will became “ONLINE” and the sensor will work properly :

2020-02-29 19:11:19.717 [hingStatusInfoChangedEvent] - ‘shelly:shellyht:f2b670’ changed from UNKNOWN to ONLINE

2020-02-29 19:11:19.904 [hingStatusInfoChangedEvent] - ‘shelly:shellyht:f2b672’ changed from UNKNOWN to ONLINE

2020-02-29 19:11:19.937 [vent.ItemStateChangedEvent] - Shellyht_Temp_Ferolli changed from NULL to 26.10 °C

2020-02-29 19:11:21.884 [vent.ItemStateChangedEvent] - Shellyht_Temp_Birouri changed from 24.90 °C to 24.88 °C

2020-02-29 19:11:22.027 [vent.ItemStateChangedEvent] - Shellyht_Temp_Ferolli changed from 26.10 °C to 26.12 °C

Anybody can help me with a better solution

I’d home in on that being your problem indicator. It’s been noted before that this is linked to the Thing silently going unavailable and associated Items silently getting updated to NULL.
It’s not something you should see really unless you are editing the Thing, it’s going something to do with discovery action by the binding.

Have you seen -

which includes a message

shellyht The current Firmware version of your Shelly device is 20191216-090428/v1.5.7@c30657ba No newer firmware available.

I think you need to sort that part out first