Closed rucanunes closed 2 years ago
No one?
You could make the template binary_sensor for them. Change the classes with your wish.
Could you please tell me how to do that?
I know where the file where "No_motion" and "motion_detected" are and I can change that, I just can't find the "open" and "closed" text....
Following this: https://www.home-assistant.io/integrations/template/
I have already changed the "no_motion" and "motion_detected" in the "cover.yaml file. I just can't find the "open" and "closed"...
Here is my Broadlink binary_sensor (template) file. ####### Broadlink Sensors converted
broadlink_s1c_backdoor:
friendly_name: "Broadlink Backdoor Sensor"
device_class: door
icon_template: >-
{% if is_state('sensor.broadlink_s1c_backdoor', 'open') %}
mdi:door-open
{% else %}
mdi:door-closed
{% endif %}
value_template: >-
{% if is_state('sensor.broadlink_s1c_backdoor', 'open') %}
on
{% else %}
off
{% endif%}
broadlink_s1c_garage_door:
friendly_name: "Broadlink Garage Door (Garden)"
device_class: door
icon_template: >-
{% if is_state('sensor.broadlink_s1c_garage_door', 'open') %}
mdi:door-open
{% else %}
mdi:door-closed
{% endif %}
value_template: >-
{% if is_state('sensor.broadlink_s1c_garage_door', 'open') %}
on
{% else %}
off
{% endif%}
broadlink_s1c_rolling:
friendly_name: "Broadlink Rolling Door"
device_class: garage_door
icon_template: >-
{% if is_state('sensor.broadlink_s1c_rolling', 'open') %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}
value_template: >-
{% if is_state('sensor.broadlink_s1c_rolling', 'open') %}
on
{% else %}
off
{% endif%}
broadlink_s1c_bedroom_win_r:
friendly_name: "Broadlink TC Bedroom Win R"
device_class: window
icon_template: >-
{% if is_state('sensor.broadlink_s1c_bedroom_win_r', 'open') %}
mdi:window-open
{% else %}
mdi:window-closed
{% endif %}
value_template: >-
{% if is_state('sensor.broadlink_s1c_bedroom_win_r', 'open') %}
on
{% else %}
off
{% endif%}
broadlink_s1c_bedroom_win_l:
friendly_name: "Broadlink TC Bedroom Win L"
device_class: window
icon_template: >-
{% if is_state('sensor.broadlink_s1c_bedroom_win_l', 'open') %}
mdi:window-open
{% else %}
mdi:window-closed
{% endif %}
value_template: >-
{% if is_state('sensor.broadlink_s1c_bedroom_win_l', 'open') %}
on
{% else %}
off
{% endif%}
broadlink_s1c_downstair_win:
friendly_name: "Broadlink Downstair Window"
device_class: window
icon_template: >-
{% if is_state('sensor.broadlink_s1c_downstair_win', 'open') %}
mdi:window-open
{% else %}
mdi:window-closed
{% endif %}
value_template: >-
{% if is_state('sensor.broadlink_s1c_downstair_win', 'open') %}
on
{% else %}
off
{% endif%}
broadlink_s1c_upstair_win:
friendly_name: "Broadlink Upstair Window"
device_class: window
icon_template: >-
{% if is_state('sensor.broadlink_s1c_upstair_win', 'open') %}
mdi:window-open
{% else %}
mdi:window-closed
{% endif %}
value_template: >-
{% if is_state('sensor.broadlink_s1c_upstair_win', 'open') %}
on
{% else %}
off
{% endif%}
broadlink_s1c_cathy_win:
friendly_name: "Broadlink Cathy Window"
device_class: window
icon_template: >-
{% if is_state('sensor.broadlink_s1c_cathy_win', 'open') %}
mdi:window-open
{% else %}
mdi:window-closed
{% endif %}
value_template: >-
{% if is_state('sensor.broadlink_s1c_cathy_win', 'open') %}
on
{% else %}
off
{% endif%}
broadlink_s1c_livingroom_pir:
friendly_name: "Broadlink PIR LVR"
device_class: motion
icon_template: >-
{% if is_state('sensor.broadlink_s1c_livingroom_pir', 'motion_detected') %}
mdi:run
{% else %}
mdi:walk
{% endif %}
value_template: >-
{% if is_state('sensor.broadlink_s1c_livingroom_pir', 'motion_detected') %}
on
{% else %}
off
{% endif%}
broadlink_s1c_tc_room_pir:
friendly_name: "Broadlink PIR TC Bedroom"
device_class: motion
icon_template: >-
{% if is_state('sensor.broadlink_s1c_tc_room_pir', 'motion_detected') %}
mdi:run
{% else %}
mdi:walk
{% endif %}
value_template: >-
{% if is_state('sensor.broadlink_s1c_tc_room_pir', 'motion_detected') %}
on
{% else %}
off
{% endif%}
broadlink_s1c_cathy_room_pir:
friendly_name: "Broadlink PIR Cathy Bedroom"
device_class: motion
icon_template: >-
{% if is_state('sensor.broadlink_s1c_cathy_room_pir', 'motion_detected') %}
mdi:run
{% else %}
mdi:walk
{% endif %}
value_template: >-
{% if is_state('sensor.broadlink_s1c_cathy_room_pir', 'motion_detected') %}
on
{% else %}
off
{% endif%}
broadlink_s1c_mc_room_pir:
friendly_name: "Broadlink PIR MC Room"
device_class: motion
icon_template: >-
{% if is_state('sensor.broadlink_s1c_mc_room_pir', 'motion_detected') %}
mdi:run
{% else %}
mdi:walk
{% endif %}
value_template: >-
{% if is_state('sensor.broadlink_s1c_mc_room_pir', 'motion_detected') %}
on
{% else %}
off
{% endif%}
broadlink_s1c_upstair_pir:
friendly_name: "Broadlink PIR Upstair"
device_class: motion
icon_template: >-
{% if is_state('sensor.broadlink_s1c_upstair_pir', 'motion_detected') %}
mdi:run
{% else %}
mdi:walk
{% endif %}
value_template: >-
{% if is_state('sensor.broadlink_s1c_upstair_pir', 'motion_detected') %}
on
{% else %}
off
{% endif%}
Thank you for your help!! All this goes to sensor.yaml?
Thank you for your help!! All this goes to sensor.yaml?
No, it is binary_sensor.yaml file
Unfortunately, home assistant have only such constants https://github.com/home-assistant/core/blob/dev/homeassistant/const.py
STATE_ON: Final = "on" STATE_OFF: Final = "off" STATE_HOME: Final = "home" STATE_NOT_HOME: Final = "not_home" STATE_UNKNOWN: Final = "unknown" STATE_OPEN: Final = "open" STATE_OPENING: Final = "opening" STATE_CLOSED: Final = "closed" STATE_CLOSING: Final = "closing" STATE_PLAYING: Final = "playing" STATE_PAUSED: Final = "paused" STATE_IDLE: Final = "idle" STATE_STANDBY: Final = "standby" STATE_ALARM_DISARMED: Final = "disarmed" STATE_ALARM_ARMED_HOME: Final = "armed_home" STATE_ALARM_ARMED_AWAY: Final = "armed_away" STATE_ALARM_ARMED_NIGHT: Final = "armed_night" STATE_ALARM_ARMED_VACATION: Final = "armed_vacation" STATE_ALARM_ARMED_CUSTOM_BYPASS: Final = "armed_custom_bypass" STATE_ALARM_PENDING: Final = "pending" STATE_ALARM_ARMING: Final = "arming" STATE_ALARM_DISARMING: Final = "disarming" STATE_ALARM_TRIGGERED: Final = "triggered" STATE_LOCKED: Final = "locked" STATE_UNLOCKED: Final = "unlocked" STATE_LOCKING: Final = "locking" STATE_UNLOCKING: Final = "unlocking" STATE_JAMMED: Final = "jammed" STATE_UNAVAILABLE: Final = "unavailable" STATE_OK: Final = "ok" STATE_PROBLEM: Final = "problem"
so, there are no constants for STATE_NO_MOTION = "no_motion" STATE_MOTION_DETECTED = "motion_detected" STATE_TAMPERED = "tampered" STATE_ALARM_SOS = "sos"
and this component introduces its constants, but unfortunately, they need to be localized by the user himself. In the future, I will try to make the pull request in Home Assistant to add new constants there. But the likelihood that they will be accepted is minimal. In addition, many users have already used the constants in form in which they are now and I do not want to break compatibility to them. Thank you for the great template solution!
Does anyone knows where I can change these text?