Hi all,
I am newbie to HASS, I tried to find similar issue but still cannot find any similar issue/solution so I am creating this topic.
I have 2 door sensors monitoring door open/close state with open duration of each sensor as .json payload below:
{
"main_door": false,
"main_door_open_duration": 0,
"back_door": true,
"back_door_open_duration": 10,
"version": "1.1"
}
I would like to use flex-table-card to display state + open duration of both sensors like this (read only):
I tried to created a mqtt sensor in configuration.yaml file, but I cannot get it work
This is my mqtt sensor config.:
mqtt:
sensor:
- name: "DoorMainX"
state_topic: "home/main/sensor/states"
value_template: '{{ value_json.main_door, value_json.main_door_lo |float|round(0) }}'
I also tried with template sensor in configuration.yaml file as below but it does not work neither:
template:
- sensor:
- name: DoorMainY
state: "{{ states('sensor.entrance_main_door'), states('sensor.entrance_main_door_opened_duration') }}"
With those above configuration, I received only table as below (missing duration):
Could you please help me to get separated State, Duration columns with correct information? Please show me which file I should add/modify configuration also (as a newbie needed)
Thanks in advance!
Thuy