Hi all,
thanks for great project as HA.
But I need a help, I searched forum and examples for whole day and tried many configs but no success.
I’ve got a json file containing:
{"tariff":"low"}
or {"tariff":"high"}
changed with current energy tariff.
In configuration.yaml I have:
sensor:
- platform: file
file_path: /run/tariff.json
name: Energy tariff
value_template: '{{ value_json.tariff }}'
and automations.yaml:
- alias: ventilation on
trigger:
- platform: template
value_template: "{{ is_state('sensor.tariff', 'low') }}"
action:
- service: fan.turn_on
entity_id:
- fan.intake_fan
- fan.exhaust_fan
- alias: ventilation off
trigger:
- platform: state
entity_id: sensor.tariff
to: 'high'
action:
- service: fan.turn_off
entity_id:
- fan.intake_fan
- fan.exhaust_fan
I want to turn on and off, but it doesn’t work. As you can see I tried both state and template. I think the problem is that the sensor is not binary_sensor.
How to make binary_sensor from file or from sensor?
Thanks
Jiri