Skip to content
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

Home Assistant Warning: "Template variable warning: 'dict object' has no attribute 'displaymetric' when rendering '{{ value_json.displaymetric }}' #1681

Closed
Snuffy2 opened this issue Jun 13, 2023 · 8 comments

Comments

@Snuffy2
Copy link

Snuffy2 commented Jun 13, 2023

Describe the bug
Since upgrading to v1.6.0, I've been getting a lot of these errors in my Home Assistant logs.

2023-06-11 21:33:44.109 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'dict object' has no attribute 'displaymetric' when rendering '{{ value_json.displaymetric }}'

SNAG-1946

I believe it is coming from OMG and may be related to #1504 although I believe that was added in v1.5.0 and seems to be this line

I'm running a Heltec WiFi LoRa 32 (V2.1) running RTL_433 which I believe uses the SSD1306 Display. I do have the display turned off.

SNAG-1945

I do not recall seeing these errors in Home Assistant with OMG v1.5.1

Environment (please complete the following information):

  • OpenMQTTGateway version used (V0.9.3, 0.8, development): 1.6
  • Library version related to the problem you have (if you have troubles with RF provide the version of RCSwitch library)
@Snuffy2
Copy link
Author

Snuffy2 commented Jun 14, 2023

I turned on the Display to see if that had any effect and it didn't seem to change anything. The error is still appearing. Another thing I noticed is that displayMetric is not listed as an item in the SSD1306toMQTT JSON when looking with MQTT Explorer. It is listed under WebUItoMQTT and changes when I check/uncheck the Display Metric box in the WebUI.

2023-06-13_20-44-17 645

@DigiH
Copy link
Collaborator

DigiH commented Jun 14, 2023

This looks like a legacy discovery for displaymetric for SSD1306, from before it was moved to the WebUI. Needs to be removed for SSD1306/moved to WebUI.

@DigiH
Copy link
Collaborator

DigiH commented Jun 30, 2023

Hi @Snuffy2

would you be able to verify with a test build?

@DigiH
Copy link
Collaborator

DigiH commented Jul 2, 2023

@Snuffy2

A test build which should fix the warning messages can be installed at

https://docs.openmqttgateway.com/dev/upload/web-install.html

If you could also check the correct switching between metric and imperial units, that would be great.

@Snuffy2
Copy link
Author

Snuffy2 commented Jul 7, 2023

I installed version 9d8a96 this evening.

  • The Template variable warning is no longer showing
  • I unchecked Display Metric in the WebUI. The change was shown in MQTT Explorer but the temperatures continue to show in °C
2023-07-06_21-08-23 127 2023-07-06_21-01-07

@DigiH
Copy link
Collaborator

DigiH commented Jul 7, 2023

Thanks for testing @Snuffy2

The displayMetric setting only applies to the alternating device property unit display on the WebUI main page and on the Heltec/LilyGo internal OLED display.

The rtl_433 published MQTT messages will always have temperature_C, which can/should be auto converted to Fahrenheit if so defined in HA.

I was more curious as to whether the switching also works now in the HomeAssistant Gateway Control for the different display on the Heltec and WebUI.

@Snuffy2
Copy link
Author

Snuffy2 commented Jul 7, 2023

Gotcha. The temperature does show correctly in °F in the WebUI when I uncheck Display Metric.

@DigiH
Copy link
Collaborator

DigiH commented Jul 8, 2023

Thanks for the confirmations.

Closing

@DigiH DigiH closed this as completed Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants