Hi everyone,
this is my first post, so I hope to match the Help Us Help You guidelines as closely as possible.
TL;DR - A Room thing added using the Netatmo openHAB binding to support a bTicino Smarther2 thermostat never leaves the UNKNOWN
state.
In the first place, bridge settings make it unclear to me whether Room is the correct thing type to use as parent of the Thermostat.
Context
As mentioned in the topic title, I own a bTicino Smarther2 thermostat, which is natively integrated with the Netatmo home automation system as well as with the Apple Homekit interface. As per the vendor instructions, I have set it up in my home network using the Legrand/Netatmo/bTicino Home + Control app, which guides through the process of adding it as a Homekit bridge and binds it to a Netatmo account, allowing full control and scheduling both from the local network and while away (through the cloud), both from Apple Home and from the Home + Control app. No problem so far.
With the goal of adding the thermostat to my openHAB instance, I browsed through all possibly relevant add-ons, finding out the following:
- BTicinoSmarther: this is meant to work with an older generation of the same thermostat (Smarther X8000), and I know for sure that is not relevant because I also own one such thermostat and I could successfully add it to openHAB using a bridge connecting to the Works with Legrand developer API. The Smarther2 generation uses a completely different interface and API (therefore binding).
- OpenWebNet (BTicino/Legrand): this is meant to operate with MyHOME BUS or ZigBee devices supporting the OpenWebNet protocol; to the best of my knowledge, the bTicino Smarther2 thermostat does not support any such protocols.
- Netatmo has therefore been my final choice; the rest of this post only considers this binding.
Problem statement
Adding the Smarther2 thermostat using the Netatmo binding fails for an apparently unknown reason. This is what I have tried so far:
- Following the instructions, I could successfully register an application on the Netatmo developer portal and add a Netatmo Account thing to my openHAB instance, which I have also authorized with Netatmo Connect and is now in the
ONLINE
state - I have retrieved my
home_id
by querying the âliveâ Netatmo APIs from the Home+Control API Documentation page and I could successfully add a Home thing to my openHAB, which is also in theONLINE
state
Doubts arose at this point, because the Home + Control API seems to organize a house into homes
, rooms
and modules
, and the Netatmo binding documentation confirms that Thermostat devices are âplaced in a given roomâ. Therefore:
- I have retrieved the
id
of the room that contains the Smarther2 thermostat and tried to add it as a Room thing, but this has always been stuck in theUNKNOWN
state. After checking several times the correctness of the retrieved roomid
I even tried, improperly, to use something different as the Thing ID for the Room thing (e.g., the MAC address of the Thermostat itself), but nothing changed of course.
So, this is the first problem: the Room thing never leaves the UNKNOWN
state.
Investigating further, I have realized that a Netatmo Thermostat thing cannot even be bound to a Room bridge (such bridge is not even listed when adding a Thermostat thing), but can be bound to a Relay bridge instead, as also confirmed in this post. I found this rather surprising because Relays and Thermostats together do not expose any channels that have anything to do with temperatures or furnace status, but I have made an attempt to go this way:
- I have added a fictitious Relay thing pointing to the MAC address of the Smarther2 thermostat (I know that this is unexpected to work, but actually I do not own any relays), and it stuck on the
UNKNOWN
state as well, this time expectably.
And so, here is the second problem: what kind of thing should I use in the first place to add my Smarther2 thermostat, given that I do not own any relays or valves but just the thermostat itself ?
My heartfelt thank you goes to anyone who dares to read so far and propose hints to address this issue.
Technical information
- openHAB version: 3.4.1 (release build)
- Platform: official Docker image, with
network_mode
set tohost
- Host: Raspberry Pi 4B running
Raspbian GNU/Linux 11 (bullseye)
, 32-bit version (it is unlikely to be relevant, but thearm_64bit
option is set to1
to work around a completely independent issue)
Investigations so far
Performed searches
Click here to expand
Documentation aside, I have browsed through the community forum in search of a similar case, finding some hints but no true solutions:
- BTicino Smarther Bridge + Smarther 2 with Netatmo (no solution, possibly slightly different issue)
- BTicino Home + Control binding (older discussion related to developing support for the Home+Control APIs)
- Error communicating with Smarther v2 in OpenHAB (promising topic, unrelated error, possibly improperly using the Works with Legrand APIs)
- Netatmo Thermostat File Binding (netatmo.things) (relevant, dealing with a slightly different error)
- Github issue #12764 - [Netatmo] Problem during update of âroomâ thing (apparently same issue as in the post above; deals with things repeatedly reported as unreachable and, therefore, switching between the
ONLINE
andOFFLINE
states; differs from my issue) - New Netatmo binding (starting OH 3.3 M5) (again possibly same issue as above; various issues following a major Netatmo binding upgrade, but none apparently comparable to mine)
- Openhab 3 and Bticino Smarther Chronothermostats (supposedly announced development steps to support new API specifications; most likely already happened since the date of the posts)
- Github issue #13403 - [Netatmo] Room-Thing offline after restart (a detected race condition that causes the Room thing to sometimes switch to
OFFLINE
; possibly unrelated to my issue) - The release notes of the recently released openHAB 3.4.2 (latest at the time of writing) suggest that no relevant changes have happened to the Netatmo binding, so I did not attempt to upgrade
- Prominent announcements on the Works with Legrand portal as well as on the Legrand developer forum state deprecation of the Home + Control API on Works with Legrand. In my opinion, this should be unaffecting because 1) the statement just seems to imply that such APIs are now supported by Netatmo Connect instead; 2) there is no such statement in the Home + Control API documentation; 3) even the Energy API, which I suppose to be stable, has a very similar interface to the Home + Control one; 4) looking at some fragments of the openHAB Netatmo binding source code, they seem to match the current Netatmo Connect specification (see, e.g., the URL constants). This is fairly aligned with what was discovered in this post.
Troubleshooting steps
Click here to expand
- Restarting openHAB (actually its Docker container) does not help.
- Restarting the
org.openhab.binding.netatmo
bundle from the Karaf openHAB console does not help. - The Karaf openHAB console does not output anything sensitive when the Room thing is disabled and enabled again:
19:44:19.886 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'netatmo:room:d82368ebbd:39f86e0de6' changed from UNINITIALIZED to UNINITIALIZED (DISABLED)
19:44:23.717 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'netatmo:room:d82368ebbd:39f86e0de6' changed from UNINITIALIZED (DISABLED) to INITIALIZING
19:44:23.728 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'netatmo:room:d82368ebbd:39f86e0de6' changed from INITIALIZING to UNKNOWN
- The same happens if ancestor things (Home, Account) are disabled and enabled again (remember that they always correctly reach the
ONLINE
state anyway). - The following messages are sometimes emitted:
19:45:47.015 [WARN ] [b.core.thing.binding.BaseThingHandler] - Handler ApiBridgeHandler of thing netatmo:account:ae4c66b9e8 tried checking if channel monitoring#request-count is linked although the handler was already disposed.
19:45:47.176 [WARN ] [b.core.thing.binding.BaseThingHandler] - Handler DeviceHandler of thing netatmo:home:ae4c66b9e8:d82368ebbd tried accessing its bridge although the handler was already disposed.
Apparently, these have no adverse effects on the operation of the affected Account and Home things. There is a long thread discussing this issue, among others, but it seems to relate to authorization failures, which I am not experiencing. Another thread discusses queued callbacks and, again, this is not my case as I am not using callbacks at all.
To be honest, these warnings do not worry me very much because the Room thing state has always been UNKNOWN
regardless of them being issued or not.
- Setting the log level for the
org.openhab.binding.netatmo
logger toTRACE
shows the following (again when disabling and re-enabling the Room thing; sensitive information edited):
19:53:48.674 [DEBUG] [g.netatmo.internal.action.RoomActions] - Netatmo RoomActions service created
19:53:48.681 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'netatmo:room:d82368ebbd:39f86e0de6' changed from UNINITIALIZED (DISABLED) to INITIALIZING
19:53:48.687 [DEBUG] [etatmo.internal.handler.ModuleHandler] - Initializing handler for thing netatmo:room:d82368ebbd:39f86e0de6
19:53:48.691 [INFO ] [hab.event.ThingStatusInfoChangedEvent] - Thing 'netatmo:room:d82368ebbd:39f86e0de6' changed from INITIALIZING to UNKNOWN
19:53:50.693 [TRACE] [tmo.internal.handler.ApiBridgeHandler] - executeUri GET https://api.netatmo.com/api/homesdata?home_id=.........
19:53:50.765 [TRACE] [tmo.internal.handler.ApiBridgeHandler] - executeUri returned : code [200 OK] body {"body":{"homes":[{"id":".........","name":".........","altitude":149,"coordinates":[.........,.........],"country":"IT","timezone":"Europe\/Rome","rooms":[{"id":".........","name":".........","type":"corridor"}],"schedules":[.........],"name":".........","default":false,"away_temp":12,"hg_temp":7,"id":".........","selected":true,"type":"therm"}]}],"user":{"email":".........","language":"it-IT","locale":"it-IT","feel_like_algorithm":0,"unit_pressure":0,"unit_system":0,"unit_wind":0,"id":"........."}},"status":"ok","time_exec":0.01612710952758789,"time_server":1676746430}
19:53:50.772 [TRACE] [tmo.internal.handler.ApiBridgeHandler] - executeUri GET https://api.netatmo.com/api/homestatus?home_id=.........
19:53:50.824 [TRACE] [tmo.internal.handler.ApiBridgeHandler] - executeUri returned : code [200 OK] body {"status":"ok","time_server":1676746431}
19:53:50.828 [DEBUG] [.handler.capability.RefreshCapability] - Module refreshed, next one in 180 s
So, no errors at all in contacting the APIs and successfully returned home topology (including a room
with its id
).
- Discovery of Netatmo things, as mentioned in the documentation, does not produce any results, even when the scan is manually started from the Things/Netatmo binding page (
/settings/things/add/netatmo
).