Appdaemon set_state - object has no attribute 'set_state'

Hello,

I’m did upgrade appdaemon (3.0.0) and homeassistant (0.65.6)and I see that set_state is not working anymore. It use to work :slight_smile: Any help? This is why I implemented appdaemon for get_state and set_state. All my scripts are half dead now.

The code is
self.set_state(“default”,entity,state=entityState[‘state’], attributes=entityState[‘attributes’])

and the log
AttributeError: ‘Groupper’ object has no attribute ‘set_state’

I discovered that also old code get_state need to be changed in this version from self.get_state(“sensor”) to self.get_state(“default”, “sensor”), but at least this one works.

Thanks

I haven’t had any problem with set_state. What is the object Groupper derived from?

setting default is normally not neccesary.

i have a lot of set_states all like:

self.set_state(entity, state=state, attribute={})

we need more then 1 line from a logfile to determine what is wrong in your case.
but my intuition tell me that the class isnt connected to hass.Hass but to apapi.Appdaemon

You need to edit all of your apps when you upgrade from 2 to 3, there are details in the docs.

thanks for all answers. I made an downgrade last night because my flowers watering depends on these scripts🌻
I have seen in the log that error related to set_state is from apapi.Appdaemon, not from hass.Hass. The Groupper class is derived from appapi.
Where to find docs to help me to change the scripts to use hass instead of apapi?
It is true I’m new in appdaemon, so please excuse me for any stupid question.

http://appdaemon.readthedocs.io/en/latest/#upgrading-from-2-x

I will upgrade again next week and change existing scripts. thanks!