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

Template variable warning: 'value_json' is undefined #1301

Open
wiedwo opened this issue Jul 10, 2024 · 11 comments
Open

Template variable warning: 'value_json' is undefined #1301

wiedwo opened this issue Jul 10, 2024 · 11 comments

Comments

@wiedwo
Copy link

wiedwo commented Jul 10, 2024

Description

2024-07-10 20:42:43.773 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'value_json' is undefined when rendering '{% set my_new = value_json|truncate(255)|regex_replace(find='^[^,]|, device firmware |,.| available',replace='') %}{% set my_cur = 'old' %}{% if my_new == '' %}{% set my_new = 'current' %}{% set my_cur = 'current' %}{% endif %}{{ {'installed_version':my_cur,'latest_version':my_new,'entity_picture':'https://adapter.ebusd.eu/favicon.ico','release_url':'https://adapter.ebusd.eu/firmware/ChangeLog'} | tojson }}'

2024-07-10 20:42:43.775 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'value_json' is undefined when rendering '{% set my_new = value_json|truncate(255)|regex_replace(find=',.*| available|revision v|version v|OK',replace='') %}{% if my_new == '' %}{% set my_new = '23.2' %}{% endif %}{{ {'installed_version':'23.2','latest_version':my_new,'entity_picture':'https://ebusd.eu/logo-32x32.png','release_url':'https://github.com/john30/ebusd/releases/latest'} | tojson }}'

Actual behavior

none

Expected behavior

startup error

ebusd version

23.2

ebusd arguments

none

Operating system

Debian 12 (Bookworm) / Ubuntu 22-23 / Raspberry Pi OS 12 (including lite)

CPU architecture

x64

Dockerized

None

Hardware interface

Adapter Shield v5 via Ethernet

Related integration

MQTT Home Assistant via mqtt-hassio.cfg

Logs

none

@john30
Copy link
Owner

john30 commented Jul 13, 2024

what are the arguments given to ebusd? maybe --mqttjson is missing?

@wiedwo
Copy link
Author

wiedwo commented Jul 16, 2024

ebusd --foreground --mqtthost=core-mosquitto --mqttport=1883 --mqttuser=addons --mqttpass=Noh3ahth2helo5AoX7CheRiaFoo8in7uv1ohyeiphaith6ohquiedaewookie4Ai --scanconfig --mqttjson --configpath=/config/ebusd-configuration/ochsner/1524849 --latency=40 --accesslevel=* --pollinterval=10 --mqttint=/config/ebusd-configuration/mqtt-hassio.cfg --mqttvar="filter-name=" --mqtttopic=ebusd --device=ens:192.168.178.68:9999 --log=all:info

2024-07-16 12:49:11.007 [main notice] ebusd 23.2.p20230716 started with auto scan on device: 192.168.178.68:9999, enhanced

@john30
Copy link
Owner

john30 commented Sep 5, 2024

seems to be some issue with HA not providing the message value as "value_json" variable. did you change the mqtt-hassio.cfg file? or somehow disable mqtt json support in HA?

@john30
Copy link
Owner

john30 commented Oct 26, 2024

if this is still an issue, then please post here the value actually sent to HA in the MQTT integration for the global/updatecheck topic

@AlexandreA74
Copy link

I have the same issue on a new installation, with an adapter I ordered last year.

Should I update the firmware of the adapter ? I was thinking it would not matter, it was working fine in the past, and this warning started to come a few months ago. I had to reinstall everything for other reasons.

image

@john30
Copy link
Owner

john30 commented Nov 26, 2024

again the question if --mqttjson was passed to ebusd as I doubt that

@AlexandreA74
Copy link

Yes, ebusd runs with the --mqttjson option set

@john30
Copy link
Owner

john30 commented Nov 26, 2024

and was the updatecheck topic last pushed to recently, i.e. with the mqttjson set?

@AlexandreA74
Copy link

I'm running 20231015 on the adapter - would updating it help ?

@john30
Copy link
Owner

john30 commented Dec 1, 2024

I don't think so. it anyway depends on when the message was last received, so please just check in HA when the last message was received. i suspect that to be too old

@AlexandreA74
Copy link

You are right: the message is not appearing anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants