GAHA
1
In configuration.yaml…
template:
sensor: !include_dir_merge_list template/sensor/
binary_sensor: !include_dir_merge_list template/binary_sensor/
trigger: !include_dir_merge_list template/trigger/
In template/sensor/sensors.yaml…
- name: "Hello World"
state: >-
{{ states('blah') }}
Doesn’t work anymore??? It use to, not sure what changed?
When I say it doesn’t work, I mean the sensor shows up as sensor.hello_world, but the state is unknown.
Anyone know how to fix?
GAHA
2
Ha, just figured out the issue.
template:
- sensor: !include_dir_merge_list template/sensor/
- binary_sensor: !include_dir_merge_list template/binary_sensor/
- trigger: !include_dir_merge_list template/trigger/
Not,
template:
sensor: !include_dir_merge_list template/sensor/
binary_sensor: !include_dir_merge_list template/binary_sensor/
trigger: !include_dir_merge_list template/trigger/
Funny as like I said the latter worked fine until recently ![:man_shrugging: :man_shrugging:](https://community.home-assistant.io/images/emoji/twitter/man_shrugging.png?v=10)
1 Like
GAHA
3
How would we go about defining templates in multiple locations? Use case is I want to share the same sensor between two home assistants.
Something like…
template:
- sensor: !include_dir_merge_list template/sensor/
- binary_sensor: !include_dir_merge_list template/binary_sensor/
- trigger: !include_dir_merge_list template/trigger/
template_shared:
- sensor: !include_dir_merge_list /home/homeassistant/shared/template/sensor/
- binary_sensor: !include_dir_merge_list/home/homeassistant/shared/ template/binary_sensor/
- trigger: !include_dir_merge_list /home/homeassistant/shared/template/trigger/
Anyone have any ideas?
GAHA
4
Didn’t think it would, but this works…
template:
- sensor: !include_dir_merge_list template/sensor/
- sensor: !include_dir_merge_list ../shared/template/sensor/
poudenes
(Poudenes)
5
how does your triggers look like. Because trigger is already there but can’t work without:
- trigger:
- platform: webhook
webhook_id: "postgress_backup"
local_only: true
allowed_methods:
- POST
- PUT
sensor:
- name: "Webhook Postgress Template"
state: "{{ trigger.json }}"
I got a error when check configuration.
Invalid config for [template]: required key not provided @ data[‘trigger’][0][‘platform’]. Got None.
GAHA
6
@poudenes
In configuration.yaml, do you have…
template: !include templates.yaml
Where is template:
defined?
template:
- trigger:
- platform: webhook
webhook_id: my-super-secret-webhook-id
sensor:
- name: "Webhook Temperature"
state: "{{ trigger.json.temperature }}"
unit_of_measurement: °C
poudenes
(Poudenes)
7
already solved it. Thanks