Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template variable warning: 'dict object' has no attribute 'temp' #888

Closed
eelcohn opened this issue Jan 5, 2023 · 5 comments
Closed

Template variable warning: 'dict object' has no attribute 'temp' #888

eelcohn opened this issue Jan 5, 2023 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@eelcohn
Copy link

eelcohn commented Jan 5, 2023

I'm using EMS-ESP v3.4.4 with MQTT auto-discovery in Home Assistant. When a Dallas sensor reports 85,0 °C, the value is not available in the MQTT payload, and Home Assistant reports a warning:

Logger: homeassistant.helpers.template
Source: helpers/template.py:589
First occurred: 11:28:38 (1114 occurrences)
Last logged: 20:34:17

Template variable warning: 'dict object' has no attribute 'temp' when rendering '{{value_json['12-3456-789A-BCDE'].temp}}'

Ideally the temp attribute should be set to the value of the Dallas sensor (85,0 °C), or it could even be set to null to report to Home Assistant that no valid temperature is available.

@proddy
Copy link
Contributor

proddy commented Jan 10, 2023

There was a whole thread about this in #466

85 is indeed an invalid reading, typically from cheaper DS18B20 clones. I thought in EMS-ESP we filter them out and don't send the MQTT payload but I couldn't find it in the code (@MichaelDvP do you remember?)

@proddy proddy added the question Question about something label Jan 10, 2023
@MichaelDvP
Copy link
Contributor

@proddy You have already referenced #466. As harvey637 wrote, 85°C is a sign of underpower. But it is in the valid range, so we dont filter it. The guy in #466 have used parasite sensors, but i think not enabled parasite powering. (instead lower pullups).

I guess this case is similar, the sensor reports one/some 85 values and then gives error. After 5 errors in row the sensor is removed. But without any information about the system it's only a guess.

@proddy
Copy link
Contributor

proddy commented Jan 11, 2023

thanks @MichaelDvP . Your brain is like an elephant. Can you take this one?

@proddy proddy added the bug Something isn't working label Jan 11, 2023
@proddy proddy added this to the v3.5.0 milestone Jan 11, 2023
@MichaelDvP
Copy link
Contributor

Ok, as far as i see we only need a

            if (!has_value && sensor.ha_registered) {
                remove_ha_topic(sensor.id());
                sensor.ha_registered = false;

to remove the broken sensor from HA. (as for device values).

MichaelDvP added a commit to MichaelDvP/EMS-ESP32 that referenced this issue Jan 11, 2023
@proddy
Copy link
Contributor

proddy commented Jan 22, 2023

in dev-16

@proddy proddy closed this as completed Jan 22, 2023
@proddy proddy reopened this Feb 13, 2023
@emsesp emsesp locked and limited conversation to collaborators Feb 13, 2023
@proddy proddy converted this issue into discussion #1001 Feb 13, 2023
@proddy proddy removed the question Question about something label Feb 19, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants