ebusd icon indicating copy to clipboard operation
ebusd copied to clipboard

Template variable warning: 'value_json' is undefined

Open wiedwo opened this issue 1 year ago • 4 comments

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

wiedwo avatar Jul 10 '24 19:07 wiedwo

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

john30 avatar Jul 13 '24 04:07 john30

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

wiedwo avatar Jul 16 '24 10:07 wiedwo

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 avatar Sep 05 '24 04:09 john30

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

john30 avatar Oct 26 '24 05:10 john30

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

AlexandreA74 avatar Nov 16 '24 09:11 AlexandreA74

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

john30 avatar Nov 26 '24 20:11 john30

Yes, ebusd runs with the --mqttjson option set

AlexandreA74 avatar Nov 26 '24 20:11 AlexandreA74

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

john30 avatar Nov 26 '24 21:11 john30

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

AlexandreA74 avatar Nov 26 '24 21:11 AlexandreA74

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

john30 avatar Dec 01 '24 21:12 john30

You are right: the message is not appearing anymore.

AlexandreA74 avatar Dec 01 '24 22:12 AlexandreA74

ok, closing

john30 avatar Dec 14 '24 15:12 john30