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

using a scene for entity_on does not work #1

Closed
mikepell007 opened this issue Nov 24, 2018 · 4 comments
Closed

using a scene for entity_on does not work #1

mikepell007 opened this issue Nov 24, 2018 · 4 comments

Comments

@mikepell007
Copy link

If you specify a scene for entity_on, the state is always "scening" which results in:

... INFO xxx Motion Lights: Motion Sensor binary_sensor.xxx_motion triggered
... INFO xxx Motion Lights: Current state of scene.xxx_on_dim is scening
... INFO xxx Motion Lights: Entity is already switched on. Motion trigger ignored.

because if entityState == "off": will never be true for a scene.

Perhaps:

if entityState != "on", although I don't know what other affects that may have.

@danobot
Copy link
Owner

danobot commented Nov 25, 2018

Thank for that, feel free to PR a fix. I don't use scenes myself and didn't realise they have a different state :)
Can you post your configuration please?
Scenes cannot be turned off last time I read the documenation. What are you doing to turn off the scene?

@danobot
Copy link
Owner

danobot commented Nov 25, 2018

For the component to work entity_on must have on and off states. Scenes are always in scening state regardless of whether they are active or not. As such the component does not support scenes and scripts for the moment. The addition of entity_off was supposed to fix this.

The only way I can think of right now to make it work would be to separate the entity_on into entity_on and entity_state where entity_state is the entity whose state should be used to control the motion light.

I am working on a fix for this :)

@danobot
Copy link
Owner

danobot commented Nov 25, 2018

I knew there was a way to do this already... This is not documented well. You can actually specify an entity to be used for entity state and use scene/script for entity_on. You must also supply entity_off to undo what entity_on turned on.

defect_test:
  module: motion_lights
  class: MotionLights
  entity: light.tv_led
  entity_on: scene.presence_lights
  entity_off: script.turn_off_presence_lights
  sensors:
    - binary_sensor.living_room_motion

This will activate your scene, observe an entity who is part of the scene, and use the entity_off script to turn off the scene when it times out.
I will update the documentation.

@mikepell007
Copy link
Author

Ok. I did see that, but I just did not get it until now.

Thanks!

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