What I intend is to fill text_input boxes by an attribute of a json mqtt message.
In config.yaml I set up the mqtt sensor which is basically working as the payload of my message isd shown. Also the text_input seems to be OK as on a state change of my mqtt sensor a fixed value can be set. But all my attempts to get the value of a json key failed.
the received payload is:
{“type”: 55 , “loc”: “Diele”, “sa”: 44 , “family”: “0x60” , “rom”: “0x0011223344556677” }
config.yaml is this:
mqtt:
sensor:
- name: "owinet_eeprom"
state_topic: "owinet/eeprom/sensor/address"
json_attributes_topic: "owinet/eeprom/sensor/address"
json_attributes_template: "{{ value_json.value }}"
input_text:
text1:
name: owinet_json_rom
initial: "nothing"
in automations.yaml:
- alias: eeprom_json_rom
trigger:
platform: state
entity_id: sensor.owinet_eeprom
action:
- service: input_text.set_value
target:
entity_id: input_text.text1
data:
# value: "TEST" # OK Works
value_template: "{{ state_attr('sensor.owinet_eeprom','rom')}" # Nothing happens
# value: "{{ value_json.rom)}" # Nothing happens
Hence, I’n not sure if the value_template is wrong or the mqtt sensor json settings of the sensor are not OK.
Finally Iwant to achieve an input_text for each of the attributes in my json. Next I want to edit the values and publisch an mqtt message with the modified values back.
Hope someon can help on this.