Hello all,
I’m pretty new to AppDaemon and I started writing an app which uses an input_select for the GUI inside lovelace.
I need to create an input_select and actually I do like this:
The entity seems to be created but it is empty and AppDaemon log reports:
+++++++++++++++++++++++++++++++++
2020-03-08 23:16:46.774894 WARNING HASS: Error calling Home Assistant service default/input_select/set_options
2020-03-08 23:16:46.775194 WARNING HASS: Code: 400, error: 400: Bad Request
+++++++++++++++++++++++++++++++++
Instead if I create it inside homeassistant yaml file the input_select in AppDaemon is correctly filled by the same instructions tat failed before:
Yes I’m starting to think the same.
I have issue also with input_boolean.
I would like to know why…
I thought that AppDaemon could replace 100% yaml file configuration not only for automations but also for defining sensors and other data structures.
If this is not the case I would like to read it somewhere into the official documentation but I was not able to find anything…
Thanks!
Hi I tried to register the service:
I have called the register_service function which register the set_value service.
This service simply log a string in case of that event called.
Then I wait for some event with listen_event which eventually shall run the call back when any service is called.
The call back change_state_cb would log the event name.
Nothing happen when the input_text created in the GUI is changed.
class InputText(hass.Hass):
def initialize(self):
self.input_text = self.args["name"]
self.log(self.input_text)
self.register_service("input_text/set_value", self.set_value_cb)
if not self.entity_exists(self.input_text):
self.set_state(self.input_text, state = "")
self.listen_event(self.change_state_cb, event = "call_service")
def change_state_cb(self,event_name,data, kwargs):
self.log("event_name:"+event_name)
#self.call_service("input_text/set_value", entity_id = self.input_text, value = "red")
def set_value_cb(self):
self.log("set_value_cb")
The ‘register_service’ api in appdaemon is meant to create your own service.
When HA starts, if input_text is configed, the following service will be register: 1. set_value 2. reload.
You can see how are these services registered in ha log. It’s been a long time, so I can’t recall it totally.
But here’s what I found in my ad which is an app that create a input_select entity.