1 - Is it possible extract and make all binary sensors from MQTT row by one note in yaml file?
2 - Is it possible make MQTT binary sensors with attributes : “battery”, and “signal strength”?
`ERROR:homeassistant.core:BusHandler:Exception doing job
Traceback (most recent call last):
File “/usr/local/lib/python3.4/dist-packages/homeassistant/core.py”, line 852, in job_handler
func(*args)
File “/usr/local/lib/python3.4/dist-packages/homeassistant/components/mqtt/init.py”, line 171, in mqtt_topic_subscriber
event.data[ATTR_QOS])
File “/usr/local/lib/python3.4/dist-packages/homeassistant/components/sensor/mqtt.py”, line 62, in message_received
hass, value_template, payload)
File “/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/template.py”, line 37, in render_with_possible_json_value
return render(hass, template, variables)
File “/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/template.py”, line 63, in render
}).render(kwargs).strip()
File “/usr/local/lib/python3.4/dist-packages/jinja2/environment.py”, line 989, in render
return self.environment.handle_exception(exc_info, True)
File “/usr/local/lib/python3.4/dist-packages/jinja2/environment.py”, line 754, in handle_exception
reraise(exc_type, exc_value, tb)
File “/usr/local/lib/python3.4/dist-packages/jinja2/_compat.py”, line 37, in reraise
raise value.with_traceback(tb)
File “”, line 1, in top-level template code
TypeError: unsupported operand type(s) for -: ‘Undefined’ and ‘int’
It doesn’t like the “-” in your dio names, so it it is taking it as an operator… basically it is seeing it like you are doing math, subtracting 4 from dio.
Hi guys,
sorry for bringing up such an old topic but I have similar problem.
I have DIY geiger counter that uses mqtt to send its measurements in json format.
It looks like this: {"date": 31/10/2020, "time": 21:06:32, "cpm" : 59, "uSv": 0.0745, "voltage": 4.43, "time_period": 2000, "cptp": 2}
When I go to MQTT settings and subscribe to the topic “geiger/” from there - I can see the messages above.
However my HA keeps telling me that
[sensor.geiger] unavailable friendly_name: geiger
I feel myself so stupid because it seems so elementary yet I can’t get it working!
Well, I finally managed to get that working so, in case someone else is looking for the same, here is what I did.
Basically I did two steps and now sure which one helped - either this or that or both … or nothing
I send all data to homeassistant subtopic. Like for my geiger counter that goes to /homeassistant/geiger
I put “” around values as well so here it is how it looks like: