Hello! I’m attempting to build an automation for connecting an RVC Canbus network to Home Assistant by way of a script that processes the canbus messages and loads them onto an MQTT broker configured to support Home Assistant Device AutoDiscovery.
I’ve got it to the point that Home Assistant recognizes the device, but it’s not properly recognizing state. Can someone help?
Amature here, struggeling with mqtt discovery myself.
Are you aware that your brightness_state_topic and your state_topic
are exactly the same.
I could imagine that it is ambiguous (for HA) what entity you mean when you publish to that topic.
[/quote]
So I’ve told HASS via the payload_on option that my light will be considered ON when the value is “ON”. But by default, HASS is assuming the state field will be ‘power on’ or ‘power off’? So payload_on and payload_off are just for setting the command, not for the state interpretation? Hence why I need to define the state_value_template to interpret “ON” as on and not expect “power on” for determining state?
Am I understanding correctly that, you are sending the on/off_state and the brightness_state as a set (of key:value pairs) to the same topic?
And then tell HA (by the first line in your _config topic) to use the .brightness value for the brightness and the .state value for the on/off state?
Interesting
(Don’t worry explaining in too much detail… I will only need that in 2027 I think. Not fully grasping the use of templates yet.)