Call_service group/set

how can i add a new sensor created in appdaemon to the default_view?

If i dont define a default_view in HA, the sensor created in AD gets added by default at the top where rest of the other sensors are added e.g. sun, device tracker etc.

however if i define a default_view in my groups.yaml, new sensors are not added to the default_view by default.

i am trying to call group.set service call but it is not working…

self.call_service("group/set", object_id="group.default_view",name="default_view",add_entities="sensor.appd_notify")

@ReneTode any idea?

i didnt define default view, because then you cant see automatic added devices.

if you have created a default view in your groups.yaml you can add the sensor there in the yaml.

i never used the service group/set.

for pre-defined sensors yes i can add in groups.yaml. i am trying to find a way to create the dynamic sensors from AD and show them in front-end but in default_view.

without default_view it’s working fine.

i’m not really sure as how to call group.set service call and to add a newly created sensor to default_view

@aimc any idea?

in AD created sensors also.
just add it there.

Sorry to reply late …

It’s not clear that this is an issue with AD, I don’t know if it is possible to use the service in this way, does it work if you do the same thing with YAML automations? None of this is well documented and I think there may be limits to what can be done dynamically. Maybe you need to force a reload of the groups after the group/set?

Hi Andrew, not a problem.

No, i haven’t tried in yaml yet. Will give a try and see if it works there. Can we create dynamic sensors through yaml automations?

May be relaod work? Will try this as well.

What’s latest cooking in new upcoming veraion of AD by the way? Any new exciting feature you are planning to introduce?

Creation of sensors works well in AD using set_state()

Regarding new developments - I’ve been swpwd with work for the last 3 months so haven’t had time to think about it much … Good news is things should be getting quieter soon and u can get back on the case :slight_smile:

Absolutely, can’t wait more.:rofl: