i Always use what i have at hand to get what i want
if i want to put in a nail and a stone is more near then a hammer then i use a stone (or any other heavy thing that is near my hand )
but i guess i nead to read up again. so i will try to understand the kwargs part of python
This may be obvious, or perhaps it can’t even be done, but how would you send additional variables to a notify service call?
For instance, in the normal service call for a notification you would put:
self.call_service("notify/myservice", message = "My Message")
which equates to the following JSON body:
{
"message":"Testing"
}
But for the official iOS app they are working on, the notifications requires, at the very least, a notification category under the data and push subheadings, in which the JSON body looks like this:
Yep, that looks along the right lines Rene, the first example would probably work, but I believe the second would error out as you haven’t created the “push” dictionary before you reference it and add a sub-dictionary. You can also create the dictionary with a few lines of code prior to the call, maybe like this:
When I created the notify() call I figured I would have to expand on it eventually as I have a very simple case for notification compared to others, and now we have iOS (which I am looking at too) I will probably need to do some work to build this out.
I feel really stupid asking this but after reading the documentation (https://github.com/acockburn/appdaemon/blob/master/README.md) I’m still unsure how to start. I guess most of you are active ‘builders’ of apps but for now, I’m just going to be a user which is super keen on getting some apps (and especially AIMC new occupancy app) running.
I’m asking this with the perspective of a total NOOB when it comes down to Linux. To get HASS up and running I used the AIO installer and got by with the instructions I found on the AIO installer page and Brusc videos.
So given the fact that I have an RPI3 with the AIO install I still have the following Q’s (I just want to be sure as I don;t want to mess my working system);
In the instructions (the link above). It mentions “For either method you will need to clone the AppDaemon repository to the current local directory on your machine.” : Is the current local directory the HASS directory (where my configuration.yaml is stored) or is this the directory I get when I login to the RPI3?
Then: Do the configuration part according to instuctions
Then: run it via: $ appdaemon -c conf/appdaemon.cfg (can I run this from any directory?)
Then: I want to add this to startup as I don’t want to start it manually. It mentions: “To run AppDaemon at reboot, I have provided a sample init script in the ./scripts directory. These have been tested on a Raspberry PI - your mileage may vary on other systems. There is also a sample Systemd script.”. My Q: I have never added anything to a startup of an RPI. Can somebody please explain in small steps what I should do here to have the AppDeamon start automatically).
I guess from there on I’m good to go and can use Apps from others…
Again, sorry for taking your time for this basic stuff but I guess your answers might be very usefull for other NOOBS wanting to use Apps.
It doesn’t matter - you just need to clone the repository to somewhere where you can run the install. Some people make a directory to keep this kind of thing in - you could make that a subdirectory of the hass user if you like.
Yes - by this time, AppDaemon has been installed and is in your system path.
Take a look at the init script - it has instructions on how to set it up at the top.
Yep - once it is set up you add apps just by copying them into the correct directory and configuring them in the configuration file.
And this with HA_key being my HASS API password (basically nothing happen after “Got initital state”, if I press CTRL-C it says it can’t connect to HASS):
Also, the way you are starting it is with a relative path for the config file which assumes you are in the actual AppDaemon directory which probably wasn’t the case after that reboot - just use the full path or cd to the AppDir directory again.
Thanks! For completness it was indeed adding the full path (in my case: /home/pi/appdaemon/conf/apps) and HA_Key = [HASS API PASSWORD]
So this generates the correct output when executing: appdaemon -c conf/appdaemon.cfg (within the appdeamon dir, in my case /home/pi/appdaemon
Now I’m stuck with adding it to auto start. I’m following the below instructions:
#!/bin/bash
# APPDAEMON Service
# Add this file to /etc/init.d/
# $ sudo cp appdaemon /etc/init.d/
# Update variables PATH to suit your installation
# $ sudo nano /etc/init.d/appdaemon
# Make executable
# $ sudo chmod 755 /etc/init.d/appdaemon
# Update rc.d
# $ sudo update-rc.d appdaemon defaults
# APPDAEMON will start at boot. Check out the boot log for trouble shooting "/var/log/boot.log"
# USAGE: start|stop|status|logs
What I did:
I copied the appdeamon file (the one without the .service extension) to /etc/init.d/ with winSCP
sudo cp appdaemon /etc/init.d/ then generates an error (I guess this command copies the file to the correct directory but as it already exists due to step 1 it generates and error)
sudo nano /etc/init.d/appdaemon : this opens an editor. Not sure what to do here
$ sudo chmod 755 /etc/init.d/appdaemon
$ sudo update-rc.d appdaemon defaults
Then I do a sudo reboot.
I want to check what boot.log mentioned but the file does not exist.
So it could be that it’s now running but not sure how to check
Hi,
I want to test temperature sensor form a temperature sensor and to compare it with with the setpoint set using an input_slider. How can I address the temperature sensor and input_slider? I see only references to binary sensors in all the examples. thanks.
Will show you if it is running or not. When running with the init script you will want to set up logfiles for the log and error log or you won;t see what it is doing - this will also help you see if it is running or not.
The step you skipped with the editor: you need to edit the file to reflect your environment or it will almost certainly not work,
just use the appropriate entity ids they should all work. For instance, your temperature sensor should be something like sensor.temperature or some other name, When you know that you can use get_state() or listen_state() as with the other examples.
For the input slider, the same applies - you just need to know the full entity id.
It doesn’t matter where the files are as long as the directory exists.
In the init (appdaemon) file, since I can’t forsee where you will install it you need, at a minimum to set the APPDAEMON_DIR to point to where you did the clone to so that it can find the executable.
Below is output of ps -ef | grep appdaemon after a full reboot. Can you pls confirm that this confirms its running? The log file only mentions “2016-09-17 20:40:15.331272 INFO AppDaemon Version 1.3.3 starting” but nothing else.
Yes its running - buit I am guessing you still haven’t filled in the “app_dir” path in the appdaemon.cfg file. Add it in, then you should be able to restart AppDaemon with: