azogue/eventsensor

Not available via Integrations in the UI

Closed this issue · 19 comments

Wiki says: "2 ways of configuration are implemented: via UI from the Integrations menu, and, as legacy mode, via manual YAML config as a sensor platform", with a further note that "Wizard via the UI is the preferred method"

However, having installed via HACS then restarted HA with no errors logged, no integration appears in the UI for Event Sensory

Running HA 0.111.1, supervisor 227 on HassIO 4.10

It should work even without an initial HA restart ¿?

I'm on HA 0.110 yet, so not sure if something in 0.111 has broken something, I'll try it with a dev env when I get some time

I can confirm I can't access it through the UI either.

I upgraded to 0.111.3 last night and the integration started working again.

I upgraded to 0.111.3 last night and the integration started working again.

Hi @Sephyr0s, what do you mean with "started working again"?

  1. You were using it ok with HA << v111, then updated to HA v111 and it ceased to work ¿?, and then updated to 111.3 and things were ok again?
  2. You tried to install it as new integration in v111, it didn't appear in the integrations menu, and after updating to 111.3 it did show?
  3. Other combination

Sorry to be insidious, I'm just trying to make sense of what is happening :)

(from my experience, I had the 2 CCs installed, and I jumped from 110 to 111.3 without any issue)

FYI I upgraded to 111.3 earlier today, and the integration still does not appear for me.

I note you say you 'had the two CCs installed'. Two? Should I be installing something other then the Event Sensor? Currently I only have the built in Hue integration and the Event Sensor CC.

Also, from your wiki that shows how to manually set config I see you use an example for a Hue Dimmer Switch that looks like this:

sensor:

  • platform: eventsensor
    name: Dimmer switch last press
    event: hue_event
    event_data:
    id: switch_bedroom
    state: event
    state_map:

You have an id of switch_bedroom. I have entities for the battery level of all Hue dimmers, but none for the dimmer switches themselves. e.g. sensor.conservatory_switch_battery_level

@azogue Sorry, I could've been a lot clearer in my response. :)

I meant option two, I had it prior to 0.111, then a few days ago I wanted to add another Hue Remote and I wasn't allowed to add any new sensors as it didn't show under integrations (previously added sensors were still working though). When upgrading to 0.111.3 I retried it and there it was again. I'm using the UI approach btw, not the YAML one.

cc @steveelsbury

I note you say you 'had the two CCs installed'. Two? Should I be installing something other then the Event Sensor? Currently I only have the built in Hue integration and the Event Sensor CC

No, sorry. They are totally independent integrations (the common thing on both is that I'm the author, and also that they are UI-configurable).

You have an id of switch_bedroom. I have entities for the battery level of all Hue dimmers, but none for the dimmer switches themselves. e.g. sensor.conservatory_switch_battery_level

If you had HA entities for the switches then this CC would not be necessary :)
HA Core doesn't create entities for the remotes, events are fired instead. That field (id: switch_bedroom) is inside the events data, which also contains another non-pretty identifier (the unique_id)

cc @Sephyr0s

@azogue Sorry, I could've been a lot clearer in my response. :)

Don't be sorry! your feedback is very appreciated!

I meant option two, I had it prior to 0.111, then a few days ago I wanted to add another Hue Remote and I wasn't allowed to add any new sensors as it didn't show under integrations (previously added sensors were still working though). When upgrading to 0.111.3 I retried it and there it was again. I'm using the UI approach btw, not the YAML one.

Wow, then you lost the visualization of the item in integrations-menu for the eventsensors?

The thing that "previously added sensors were still working" says that this is something related to the HACS/custom_components integration with HA Core when serving the integrations menu for the frontend, not related to the actual code of the custom integration, which makes sense.

Did you have more UI-configurable custom integrations in your setup? Did these also disappear on 111.<3?
To clarify one last thing: when the eventsensor didn't appear in the add-new menu, previously configured sensors where present in the main menu, right? (so this is a thing only for adding new ones, right?)

HA Core doesn't create entities for the remotes, events are fired instead. That field (id: switch_bedroom) is inside the events data, which also contains another non-pretty identifier (the unique_id)

My question is, if I want to create manual YAML config as the Integration Wizard isn't working - how do I determine what to put in that field? I have 6 remotes around the house I need to hook up.

I cannot see how I can adapt the example in your wiki to work for my switches

hi @steveelsbury

My question is, if I want to create manual YAML config as the Integration Wizard isn't working - how do I determine what to put in that field? I have 6 remotes around the house I need to hook up.

I cannot see how I can adapt the example in your wiki to work for my switches

  • That "id" should be the slugified version of the remote's name, which should be appearing in your devices page (HA does not create entities, but it does create devices).
    So, if your device name is "Bedroom hue remote", then the id will be "bedroom_hue_remote" :)

  • or even easier: cut out the "_battery_level" postfix from your battery sensors and you have that id: "sensor.remote_bathroom_battery_level" --> id="remote_bathroom"

  • And another more: go to dev-tools->events, start listen to "hue_event" / "deconz_event" / etc (depends on the hub you're using), and then press some buttons :) You'll see that events come in, and inside the JSON data you'll see these "id" and "unique_id" fields

@azogue

Did you have more UI-configurable custom integrations in your setup? Did these also disappear on 111.<3?

I do but to be fair I didn't check for that as the integrations themselves were still working. So I'm not able to answer this one.

To clarify one last thing: when the eventsensor didn't appear in the add-new menu, previously configured sensors where present in the main menu, right? (so this is a thing only for adding new ones, right?)

This is correct. Previously configured sensors were present, but EventSensor didn't show up in the 'add'-menu. It didn't log any errors btw, just the add-menu wasn't visible.

Ahh I see - you had that documented in the wizard section. Sorry - I missed that

OK, I can see the events for the switches using the event listener, and added one to my config.yaml. The thing I am now missing is how to use what I end up with in Automations - ie when using the old Hue CC I had automations triggered ny (e.g.) State: sensor.mums_room_dimmer_switch to 1_click_up

How do I trigger the automations now?

cc @steveelsbury

How do I trigger the automations now?

To trigger automations you don't need this EventSensor.

Button presses on remotes have associated "device triggers" that you can configure via UI in the automation editor, or create new ones from the devices page. And that is the better way of doing it.

If you want to use this CC to create entities for remotes and then use those states to trigger automations, then do it exactly as any other state trigger --> https://www.home-assistant.io/docs/automation/trigger/#state-trigger, so please read the multiple documentation sources before making direct questions, for the next time, ok?

OK - my apologies for wasting your time.

Constructive suggestion - if you added the link to the state trigger documentation to your wiki page it might help others who, like me, have immense difficulty finding relevant documentation for HA. It's only easy to find when you know what you are looking for - I often find myself defeated by the very fact that there are so many documentation sources, yet so few that describe processes from beginning to end!

Thanks again and reagrds.

Sorry about the (apparent) lack of empathy in my response, it was not meant to offend you in any way.

I suppose you may have a point there, and the HA docs could be better.
They are usually very detailed, but may lack more "complete usage examples". I think that's why a lot of personal HA config repositories (like mine in https://github.com/azogue/hassio_config) got popular, as they provide these full examples that a noobie could require to start working.

And now that most of the integrations and automations are configured via UI, that problem could get bigger with time :(

Anyway, I suggest you look for examples or complete tutorials not only in the official docs or on google, but also in the HA forum (--> https://community.home-assistant.io/). That's the first place for me to look over something new or unknown.
Repository issue trackers are not meant to give user support, but to track errors and fix them :)

Going back to your initial question, here you have some automations triggered with these sensors using the state trigger: https://github.com/azogue/hassio_config/blob/fe38f22232d8e3878a102dc1aab5c34121b12312/config/automations.yaml#L280

No offense was taken! I am actually a developer myself with 40 years of experience (old dog, eh?) and the biggest challenge is always the documentation! I do agree that end-to-end guides are the holy grail.

Anyway - thanks again for your help and patience, and when I followed your original link for state triggers it all became obvious (which is more then it does when you read the Hue Integration page!) - and my automation's are all up and running again.

Keep up the good work

Regards
Steve

wow, Steve, an old dog for sure :)

Then it's time I pay my respects on you :), I have a "long" career but not so long, and I've always enjoyed and learned the most from other old dogs like you who have a special place in my heart, so, thanks to you, and my best regards :)

I'm going to close this issue, as I couldn't reproduce it in any way, and I think it was related to HA working with custom integrations with config flows, and it is not happening in newer versions...

If not, and this is still an issue, please give some feedback about and I'll reopen it :)

Hello all together,

at the moment it looks like the option to add an eventsenor as intergration in the gui disappeared again.

There is just the option to add by manufacturer and eventsensor is never showing up.

Is it possible that there is an other name used ?

My Versions :

Home Assistant 2023.4.5
Supervisor 2023.04.0
Operating System 10.0
Frontend 20230411.1 - latest

Eventsensor : latest reinstalled but no change

Greetings from Austria,

Kilowatt