Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

(v2.1x) New dallassensor mqtt topic usage? #581

Closed
giovanne123 opened this issue Oct 26, 2020 · 6 comments
Closed

(v2.1x) New dallassensor mqtt topic usage? #581

giovanne123 opened this issue Oct 26, 2020 · 6 comments
Labels
question Further information is requested

Comments

@giovanne123
Copy link

giovanne123 commented Oct 26, 2020

Tested #540 with 2.1.0b12, esp8266
Manual edit of climate.yaml, no usage of Auto discover.
Do I something wrong in the value_json?
See error in HA (0.116.4) below:

Mqtt topic and data is received as expected, checked in mqtt-explorer.

current_temperature_topic: "ems-esp/dallassensor_data"                       

current_temperature_template: "{{ value_json.10-7E42-7001-0800 }}"

2020-10-26 22:16:46 ERROR (MainThread) [homeassistant.helpers.template] Error parsing value: dict object has no element 10 (value: {"10-7E42-7001-0800":20.2}, template: {{ value_json.10-7E42-7001-0800 }})

@proddy proddy added the question Further information is requested label Oct 27, 2020
@proddy
Copy link
Collaborator

proddy commented Oct 27, 2020

The json key has special characters so you can't use the value_json.* syntax. Use [key] instead. See https://www.home-assistant.io/docs/configuration/templating/#processing-incoming-data

Also you can test yourself in HA using Developer Tools->Template and something like

{% set test = {
    "28-EA41-9497-0E03": 18.2
} %}


{{ test['28-EA41-9497-0E03'] }}

@proddy proddy closed this as completed Oct 27, 2020
@proddy
Copy link
Collaborator

proddy commented Oct 27, 2020

and you really should be using the HA format if using Home Assistant. If you don't want to use MQTT discovery turn it off in configuration.yaml.

@giovanne123
Copy link
Author

Thanks, is working.
I will give the HA format a try. Wasn't aware that there is a separate MQTT Option in EMS-ESP.
Also will have a look to the MQTT discovery. For the moment I edited manually to understand more and more, but maybe not the right way ;-)

@giovanne123
Copy link
Author

@proddy, one question before I start to modify all my setup to mqtt HA option and discovery:
Is this #438 (comment) still fact?
Because my BuderusGB132/RC30 is also configured to only be outdoortemp controlled and there isn't a "currtemp" reported therefore I currently using the external DallasSensor (attached to EMS-ESP) which is manually edited in the climate.yaml for "currtemp".
Won't this work with discovery setup?

@proddy proddy reopened this Oct 27, 2020
@proddy
Copy link
Collaborator

proddy commented Oct 27, 2020

good point, it will most likely show an error in the HA logs. I'm not sure how bad that is. I'll have to try it out myself and see.

@proddy
Copy link
Collaborator

proddy commented Oct 27, 2020

@giovanne123 see #582

@proddy proddy closed this as completed Oct 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants