Convert entity to device

Hi, I added a sonoff mini with AlexxIT’s integration, and it works fine, but it shows up as an entity and I need it on the device list so I can allocate it toa. routine.

Any ideas?
Thanks
Paul

No you don’t.

1 Like

I think the ‘growing misconception’ is spawned by the ridiculous device triggers being the default in the ui.

I agree that the representation of the automation builder in the ui should look similar to what device triggers do, but it should still actually be generating a state trigger in the code and thus be able to manage all entities.

Creating a whole new trigger/condition/action system was completely unnecessary and has just led to this misconception, and people generating horribly messy code for their automations.

2 Likes

The other issue I have with device automations is the issues that occur if you replace a device if it is faulty/stolen etc…

For state automations you just name the new entity_id the same as the old, done.

For device automations you have to search out all the occurrences of the old device_id and replace them with the new one. You cant just edit the new device id to be the same as the old one. For people only using the UI this is daunting task and they would probably end up re-writing all their ‘missing’ automations.

2 Likes

Indeed, it’s a complete mess.

Like I say, I understand the concept of the system understanding what each device can do so that in the automation ui it can present a drop-down list of all the correct options for the user to choose from and they can’t get it wrong because they use a capital letter or whatever, and that’s great.

But it should ONLY be in the ui, with the code output resolving to a ‘normal’ automation. Writing a whole new trigger/condition/action system for it was pointless and has actually caused more trouble than it’s worth.

The thing is, the device_id is needed in the automation to associate it with the list of automations on the device page. So even if your method were implemented, the device_id issue would remain.

That’s just the way they chose to implement it though.

Entity_ids are unique too, no reason that they couldn’t have associated the entity_id fields in the automations instead, because each device knows what entity_ids are associated with it.

2 Likes

In fact, @tom_l, it already does check for entity_id. I don’t use the device triggers, but my automations that use entities from a device still show in the automations section of the device page.

1 Like

So it does. You can tell I never go there :slight_smile:

1 Like

Yes, well I’m a bit of a beginner with Home Assistant, so am not writing my own scripts yet. Liked the idea of just using the automations page to turn my lights on at sunset.

Which you can totally do, without devices. In the UI.

Sorry for hijacking your topic to rant.

1 Like

The rant is interesting, i’m learning from it. I’ll look at the state trigger this evening.
Thanjs

1 Like

So I get the state trigger to trigger something, i.e, if light is switched on do this, but I want the sonoff entity to be recipient of the action. i.e. Its sunset, change entity state to on.
That’s what I’m confused by. I’ll do more digging tonight.

Trigger on the sun entity, do the sonof switching in the actions.

1 Like

It seems to me that people don’t seem to click on the “action type” drop down.

Maybe an educational video is in order?

2 Likes

Tom,

Thanks, I got there eventually. Had to work out the service actions, but got it in the end.

How I’m trying to get a BG electrical socket integration working!

Paul