Hi,
I’m coming from ioBroker and was excessively using the Javascripts for automation.
I really like the look and feel of Home Assistant but I need to find an alternative to the JS preferably in Python.
I am a embedded programmer and I really don’t like these Automations, Scenes and pseudo YAML “scripts”. I know some may prefere them but I don’t.
So I searched for a possibility for coding my scripts natively in Python.
I found AppDaemon, managed to install it and implemented my first test script.
It is time triggered and reads and sets some MQTT devices.
NICE. I thought I can automize all my things over python scripts.
But now to the problem.
I don’t get it how to define functions and make it possible to trigger them by a normal HA lovelace button.
First I thought that I need something like:
self.register_service("myservices/pc_lautspr", self.test_callback)
But I it still makes no sense and maybe AppDaemon are not the right thing to go?
I tried to create a new HA “Automation” and in my theory I thought it should be possible to trigger the function by adding a “Call Service” Action to the “Automation”. But there is nothing to select that has a similar name.
In the end I just noticed that I have no plan where to start and find out how to create a simple lovelace dash and trigger a python function from a button.
Please give me a hint.