I’ve got an MQTT keypad that I want to use with Home Assistant to disarm my house alarm.
Anyone know how I would check that the incoming MQTT contains the correct PIN? Is it just a case of setting up an MQTT sensor: and checking the state of the sensor in an automation? Or is there a better/more efficient way?
This is the page that has the bare bones of the logic.
Thank you
I’m also trying to SEND JSON to the keypad via MQTT
Invalid config for [automation]: expected a dictionary for dictionary value @ data['action'][3]['data_template']. Got None
extra keys not allowed @ data['action'][3]['payload']. Got None
extra keys not allowed @ data['action'][3]['topic']. Got None. (See /config/configuration.yaml, line 1373).
You could do that or omit the sensor and just use an MQTT Trigger in the automation.
For the service call, minimally, all lines after data_template should be indented by an additional two spaces.
If you are using a recent version of Home Assistant, the data_template option was deprecated in favor of simply using data (which can be used for options that do or do not have templates). However, the use of data_template will only cause a warning message and isn’t responsible for the error message.
Thank you, for the benefit of anyone coming after me, I was able to parse the incoming MQTT message like this (took many tries to to get the syntax/quotation marks right)