Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Conditions or enable/disable option #306

Open
spudje opened this issue Aug 16, 2023 · 1 comment
Open

Feature: Conditions or enable/disable option #306

spudje opened this issue Aug 16, 2023 · 1 comment

Comments

@spudje
Copy link

spudje commented Aug 16, 2023

Wow, this looks like a really cool addon! I can think of many uses in my setup. However, while the time constraints seem very usefull, it feels a bit cumbersome to enter them for all EC instances. So either being able to only run when a more generic condition is met, or a way to enable/disable the EC via a service would be awesome. So I can e.g. enable/disable it when my Hass setup is in Home/Away or in Day/Night mode.

@spudje spudje changed the title Conditions or enable/disable option Feature: Conditions or enable/disable option Aug 16, 2023
@dominicusmento
Copy link

dominicusmento commented Aug 18, 2023

you should create template binary sensors and achieve this by tweaking your configuration..
for example.. this one will calculate if (sun is up and illuminance >30) or light is already on
it is used for another purpose by me but you should get an idea.. templates can be easily tested in HA developer tools
you can then also use dummy switches (input_booleans) defined in your config just to trigger only one part of condition..
https://www.home-assistant.io/integrations/template/
https://www.home-assistant.io/integrations/input_boolean/

- platform: template
  sensors:
    hallway_blocker:
      friendly_name: "Hallway Light Blocker"
      value_template: >-
        {{ (states.sun.sun.attributes.elevation|float > 5 and state_attr('sensor.hallway_light_motion_sensor_1_illuminance_lux', 'illuminance')|int > 30) or is_state('light.hallway_light', 'on') }}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants