klali / ha-plejd

Plejd component for Home Assistant
Apache License 2.0
69 stars 16 forks source link

Not issue, but development idea #5

Closed BertilJ closed 5 years ago

BertilJ commented 5 years ago

Now when this is working great you of course come to think of other things that potentially can be done. :)

Would it be possible to get the button click and double click as events or similar, so they can be used for other automations?

I.e, I've got a few DIM-02 that is currently only using one output and on those wall switches I got one button that doesn't have a function, would be awesome to be able to have other automations connected to those.

klali commented 5 years ago

This might be possible, look at what happens in the callback function when a switch is pressed, by adding additional logging about what happens this might be possible to figure out. I don't have anything with unmapped inputs and aren't that interested in this for the moment.

There are additional functions in the plejds that I haven't investigate fully. The can report temperature for example though the scale is unknown and might have to be calibrated.

pezmannen commented 5 years ago

I get an event when I click my wall buttons so I could easily build stuff with that now :)

BertilJ commented 5 years ago

I get an event when I click my wall buttons so I could easily build stuff with that now :)

@pezmannen How does those events look like? I've been looking at my events and I don't get anything.

pezmannen commented 5 years ago

Are you filtering with a * ?

Looks like this

Event to subscribe to *

Event 0 fired 14:19: { "event_type": "state_changed", "data": { "entity_id": "light.kok", "old_state": { "entity_id": "light.kok", "state": "on", "attributes": { "brightness": 178, "friendly_name": "Kök", "assumed_state": true, "supported_features": 1 }, "last_changed": "2019-07-30T12:18:22.037928+00:00", "last_updated": "2019-07-30T12:18:23.498806+00:00", "context": { "id": "e0f1982e2db84cc2bc0f7f763d21c237", "parent_id": null, "user_id": null } }, "new_state": { "entity_id": "light.kok", "state": "off", "attributes": { "friendly_name": "Kök", "assumed_state": true, "supported_features": 1 }, "last_changed": "2019-07-30T12:19:59.914666+00:00", "last_updated": "2019-07-30T12:19:59.914666+00:00", "context": { "id": "cdb4de6438f74a2caa631a8a252421a4", "parent_id": null, "user_id": null } } }, "origin": "LOCAL", "time_fired": "2019-07-30T12:19:59.914848+00:00", "context": { "id": "cdb4de6438f74a2caa631a8a252421a4", "parent_id": null, "user_id": null } }

BertilJ commented 5 years ago

Yeah, but that's not the event for a button click or double click, that's the event for the light changing.

I'm looking for the actual button-click, for example to utilize double-clicks for something else or in my specific case where I have a few DIM-02 where one of the outputs are disconnected I'd like to use the button for something else than the light.

pezmannen commented 5 years ago

Aah. I see. My mistake. I also want to do that with the new battery buttons

klali commented 5 years ago

I don't see any obvious way to solve this, I don't see an event when pressing a button other than the output changing state.