Hass dropped battery_level attribute for thermostat (Danfoss LC-13)

Hi,

since about a month, I have a bunch of Danfoss LC-13 ZWave thermostats.
At that time Hass showed an attribute “battery_level” for each of the thermostats.
Apparently this attribute is now gone:

climate.danfoss_z_thermostat_014g0013_heating_1_4_1:
{
  "current_temperature": null,
  "friendly_name": "Living room",
  "max_temp": 35,
  "min_temp": 7,
  "temperature": 18,
  "unit_of_measurement": "°C"
}

Bug or feature?

Sebastian

Unless this is a result of the major refactoring the Z wave system went through in the .31 release, I think you’re going to need to look at the device side of it; HA should show what the device sends it.

I’m having the same issue with Owntracks; I used to have a battery attribute for my phone and it’s no longer there. I’m trying to figure out where it went to…

Hm, strange. I’ll have a look at ozwcp later and see what attributes are shown there.
Regarding owntracks: I see sensor.battery_DEVICE entities in Hass, showing current values (I forced a a publish in OT and immediately saw the update in Hass).
So at least for me that still seems to be working.

Sebastian

Thanks, I’ll take another look at what I’m using; perhaps it changed and I’m using an older reference.

I’ll report back on what I find.

It’s weird; if I go to the CloudMQTT WebsocketsUI, I can see the messages from my phone being sent with the full list of attributes including the battery:

Topic	                        Message
owntracks/rpitera/rpitera	{"_type":"location","tid":"ra","acc":50,"batt":96,"conn":"w","doze":false,"lat":40.6588711,"lon":-74.3902231,"tst":1479217630}

But on the HA side, I am no longer seeing the battery, only the following:

{
  "entity_picture": "http://www.westofeast.com/ha-img/myface.jpg",
  "friendly_name": "Robert-Owntracks",
  "gps_accuracy": 100,
  "latitude": 40.658939,
  "longitude": -74.39030385
}

This was the original sensor template I was using to show this attribute and it doesn’t generate an error in the dev templates panel, it just doesn’t show anything (which of course makes sense if the attribute isn’t making it to HA:

droid_battery:
       value_template: '{{ states.device_tracker.rpitera_rpitera.attributes.battery }}'

I haven’t changed anything on my MQTT setup on either end, nor have I changed anything in the Owntracks app. Everything in that set up is exactly the same as when I started and it was working. I went back and looked in the release notes for the last few versions for a breaking change related to this and found nothing.

I’m not sure if we have the same issue but it certainly looks like it at first glance.

I have a group configuration file to group battery levels for several devices.
That file only contains sensor.battery_$device entities - and it was last changed October 16th.
At least since then, the battery status couldn’t have been part of the attributes for an Owntracks-device.
Are you seeing these sensors entities for your devices?

Sebastian

No; I don’t have anything like that.

Very strange. I assumed that hass was processing the battery level information from owntracks and then generated a corresponding sensor for it.

Regarding my thermostats: I just launched ozwcp and I see the battery level info there.
It’s just gone from hass.
I do, however, get battery information from my Fibaro multisensor - so it’s not a general issue with zwave devices.

Sebastian

When you go to the dev states panel and click on the same device, what does it show there? If the battery attribute is there, you can probably use the method I showed above to create a sensor for it.

The JSON code in my original posting was copy&pasted from the dev panel.
The attribute completely disappeared from Hass.
I have an automation that was supposed to keep an eye on the battery levels, which has a bunch of statements like this:

- condition: template
  value_template: '{{ states.climate.danfoss_z_thermostat_014g0013_heating_1_2_1.attributes.battery_level < 20 }}'

So the attribute was there at some point.

I also have a zwcfg_0x12345678.xml (example id) file in my hass config directory - I suppose that’s created by hass.
That file also contains the battery level info:

# grep "Battery Level" zwcfg_*.xml
<Value type="byte" genre="user" instance="1" index="0" label="Battery Level" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="85" />
<Value type="byte" genre="user" instance="1" index="0" label="Battery Level" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="88" />
<Value type="byte" genre="user" instance="1" index="0" label="Battery Level" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="84" />
<Value type="byte" genre="user" instance="1" index="0" label="Battery Level" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="89" />
<Value type="byte" genre="user" instance="1" index="0" label="Battery Level" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="89" />
<Value type="byte" genre="user" instance="1" index="0" label="Battery Level" units="%" read_only="true" write_only="false" verify_changes="false" poll_intensity="0" min="0" max="255" value="100" />

Sebastian

Sorry I should have looked up before asking… That is strange. Mine is MQTT and yours is Zwave but the same attribute is missing. I went back and looked at my Wink based GoControl Motion sensors and my Aeotec Multisensors and all of them are showing a battery attribute.

I moved from SQLite to MySQL so I can’t really trace back to when the last time I was getting battery levels. I’m stumped. At least in my case I can do a workaround with Tasker and MQTT but I think in your case you may have to post an issue. I’d comment on the issue, but since it’s two completely different platforms I don’t know if it would be valid.

Maybe someone else will see the active thread and weigh in on this.

Thanks for the tip regarding the database. I’m using MySQL since almost from the start, so a quick look at the recorded states shows that the attribute disappeared in the evening of November 6th.
There’s a high probability that this was the time I updated to 0.32.1 which was released that day.
I’ll open an issue…

Sebastian

Here we go:

https://github.com/home-assistant/home-assistant/issues/4408

1 Like

I added my findings to your issue. Thanks.

1 Like

Well, at least it appears there’s an answer for your issue and a PR to fix it. I’m going to post my issue separately.

Yeah, looks like it’s gonna be fixed soon :slight_smile:

Sebastian