Heaty will die, Schedy be born!

Hi,

Actually, you’re using the instructions for installing hass-apps together with a fresh copy of AppDaemon into a dedicated virtualenv, as also stated by the docs page you referenced. However, you already installed AppDaemon using some other mechanism before and now have two different copies. If you want to stick with the AppDaemon you already had before, remove everything related to hass-apps and reinstall it system-wide, as you seem to also have done with AppDaemon. This is an approach that’s highly discouraged due to various reasons, but since you already did it that way…

sudo pip3 install --upgrade hass-apps

Since you not seem to be particularly familiar with these things, maybe you’d be best off switching over to hass.io and not deal with managing a GNU/Linux system yourself.

Best regards
Robert

Well at least it’s a little bit clearer :smiley:

I don’t get it …are u running HassIO? Wh, won’t u just use the appdaemon add-on with config to install hass-apps ?

Actually I am not running hass.io.

@Roschi

Will see if I have time to switch back to hass.io again. I did try that before because of the very attractive looking add-on store but I did not like the fact that I could not install programs to the side like Influxdb, Grafana etc. I know that they also can be installed through the add-on store but at some point (with merging of influx databases if I remember correctly) I was missing some functionality (or know how :sweat_smile:).

Just as an extra question: with hass.io it is NOT possible to install software outside the hass.io environment correct? (bit off-topic).

Last couple of week I have been switching from openHAB to Hass.io, Home Assistant and back again to see what is working for me. Any way will read the instruction again and see if I manage to get it working if I install the hass-apps system wide. Just out of curiosity

highly discouraged due to various reasons

What kind of reason might that be? At the moment I see myself only using Schedy and maybe trying a bit with the HADashboard, will these reasons be applicable to me?

Many thanks for the help :+1:

edit:

sudo pip3 install --upgrade hass-apps

worked for me :rofl:

between step 4 and step 5 you need to install appdaemon in the venv (pip install appdaemon)

because now you got hass-apps inside the venv and appdaemon not.

you can install appdaemon also in the venv right now.
first activate the venv

source /home/pi/appdaemon/venv/bin/activate

the install appdaemon

pip install appdaemon

from that moment on you need to activate the venv before you start appdaemon (with a service or manual)

the command to start appdaemon would stay the same, because your conf is still on the same place.

venv is a virtual environment.
when you create a new venv you create a new python environment. in which you then can install libs and packages. the reason to use venv is because different programs (HASS and appdaemon) can both need the same libs, but different versions. when you install them in 1 python environment they can bite each other.

so its wise to create 1 venv for HASS, and 1 venv for appdaemon.

Just as an extra question: with hass.io it is NOT possible to install software outside the hassio environment correct?

that depends on how you install it. there is also a docker version for hassio if i am correct, and then you can install other programs aside that docker.

Thanks for the info Rene,

will experiment with both in the future. Maybe Docker is the way to go but I do not have much experience with Docker (even less than with what we are doing now :grinning: but I keep on learning).

gr Piet

graag gedaan Piet. :wink:
and when you have more questions about using or installing appdaemon or hadashboard then please feel free to visit our discord server: https://discord.gg/pHsjADY

we also have a dutch channel there. (taking a wild guess here :wink: )

Haha you noticed my steenkolen English. Will check out the discord server. A Dutch channel will offer a nice change :smile:

Groeten Piet

1 Like

between step 4 and step 5 you need to install appdaemon in the venv (pip install appdaemon)

because now you got hass-apps inside the venv and appdaemon not.

@ReneTode That’s not correct actually. Hass-apps pulls AppDaemon as a dependency, so he had everything he needed in the virtualenv. I was just noticing that he previously installed AD system-wide including a systemd service unit, probably by following some other tutorial out there.

@poeterdebier If you want to stay with hassbian in the long run, it’s actually best to use a virtualenv as @ReneTode suggested. That way, every Python software you use can pull the exact versions of dependencies it needs. If you install everything system-wide, you’ll soon reach a point where two of the projects you use require conflicting dependencies and hence won’t work properly or at all. If you want to follow that route, you can just use the Manual Installation instructions you followed before, but then also switch the command from appdaemon to /path/to/venv/bin/appdaemon. That is the cleanest solution. You need to change the path in the systemd service file you created for running AppDaemon at system startup time.

ah thx, i didnt know that.
in that case he has AD and hassapps in a venv like needed. all he needs to realise is that he needs to activate the venv before starting AD.

in that case he has AD and hassapps in a venv like needed. all he needs to realise is that he needs to activate the venv before starting AD.

He not even has to activate it explicitly. Just using the full path to the appdaemon script for launching AD is enough, since the fact that it is part of a virtualenv is baked into the Python interpreter itself.

yeah ok.
so there are 2 ways.

Hello all,

I’m still progressing converting my automation to schedy.
Schedy is really awsome, really powerfull and yet simple. I love it.
I really like the allow_manual_change_function thing: forcing light to restore the scheduled state after wifi reconnexion when my kid plays with light switch (not the smartswitches but the main switches that are still functional but only meant as a backup in case of home assistant is down).

Anyway, if my schedule for individual bulbs is fine, I’d like to clean my template light (executing scenes before), and I’d like to use schedule_snippets for repeating triggers and conditions, please check an extract of my code below:

sejour_min:
  actors:
    light.sejour_min:
  allow_manual_changes: true
  rescheduling_delay: 0
  schedule:
    # Conditions
    - x: "Break() if is_off('input_boolean.lampes_sejour_auto') else Next()"
    - x: "Break() if is_off('binary_sensor.presence') else Next()"
    - x: "Break() if float(state('sensor.luminosite_sejour')) > float(state('input_number.seuil_luminosite')) else Next()"
    - x: "Break() if is_off('input_boolean.matin_soir') else Next()"
    # Trigger
    - x: "'on' if is_on('binary_sensor.presence') else Next()"
    - x: "'on' if state('media_player.tv_ue55ju6510_salon') == 'on' else Next()"
    - x: "'on' if is_on('binary_sensor.sejour_mouvement') else Next()"
    - x: "'on' if is_on('binary_sensor.mezzanine_mouvement') else Next()"
sejour_max:
  actors:
    light.sejour_max:
  allow_manual_changes: true
  rescheduling_delay: 0
  schedule:
    # Conditions
    - x: "Break() if is_off('input_boolean.lampes_sejour_auto') else Next()"
    - x: "Break() if is_off('binary_sensor.presence') else Next()"
    - x: "Break() if float(state('sensor.luminosite_sejour')) > float(state('input_number.seuil_luminosite')) else Next()"
    - x: "Break() if is_off('input_boolean.jour') else Next()"
    # Trigger
    # - x: "'on' if is_on('binary_sensor.presence') else Next()"
    - x: "'on' if state('media_player.tv_ue55ju6510_salon') == 'on' else Next()"
    - x: "'on' if is_on('binary_sensor.sejour_mouvement') else Next()"
    - x: "'on' if is_on('binary_sensor.mezzanine_mouvement') else Next()"

As you can see, 3 out of 4 conditions are common, and 3oo3 triggers are.
That’s easy to put triggers in a snipet, but the conditions, the way I wrote them, it’s difficult.

Any idea to have a “breaking” schedule_snippet?

Any idea to have a “breaking” schedule_snippet?

Did you understand the difference between Break() and Abort()? I just want to make sure you did, because your Break() will only break out of the sub-schedule it’s used in, not the whole scheduling. In your case, schedule_append will still be considered after one of the breaks catched, don’t know whether that’s what you want or not.

In any case, please revisit the docs about these things.

EDIT: The development version of these docs does a better job in explaining actually.

Hello,

Yes I think:
Break() break the schedule and,
Abort() abort all.

Here I don’t want to abort, I want to append.

I guess what I want to do is Break(2) in a subschedule !

Then schedule_append is applied and light are off if initial conditions are not met

Thank you for doc:latest :wink:

I guess what I want to do is Break(2) in a subschedule !

Then schedule_append is applied and light are off if initial conditions are not met

Exactly!

1 Like

That’s working perfectly !

  schedule_snippets:
  # Entrée
    conditions_entree:
    - x: "Break(levels=2) if is_off('input_boolean.lampes_entree_auto') else Next()"
    - x: "Break(levels=2) if float(state('sensor.sejour_luminosite')) > float(state('input_number.seuil_luminosite')) else Next()"
    trigger_entree:
    - x: "'on' if is_on('binary_sensor.entree_porte') else Next()"
    - x: "'on' if is_on('binary_sensor.entree_mouvement') else Next()"
    - x: "'on' if is_on('binary_sensor.chambre_bas_mouvement') else Next()"

  schedule_append:
    - v: 'off'

  rooms:
    entree_etabli:
      actors:
        light.entree_etabli:
      allow_manual_changes: false
      schedule:
        # Conditions
        - x: "IncludeSchedule(schedule_snippets['conditions_entree'])"
        # Triggers
        - x: "IncludeSchedule(schedule_snippets['trigger_entree'])"
        - x: "'on' if is_on('input_boolean.lampe_etabli_verrouillee') else Next()"

Thank you @roschi !

Is this ETH: 0xa424975a19903F7A6253bA00D5C3F28fACff3C6B still valid ?

Thank you @roschi !

You’re welcome!

Is this ETH: 0xa424975a19903F7A6253bA00D5C3F28fACff3C6B still valid ?

I think so, however I updated it to be 100% sure: 0xCE6B204B6AB5B93156f4FCD373482e148753beAb

https://etherscan.io/tx/0x4baa461e634300b067d14cf98b50433fe6d74506a5b390d6943fa39501fce4cc

Thank you for all your work!

Is it possible to evaluate this in Schedy?

  - device_id: 5cedd0e7c0044ed9a26733420633a0c6
    domain: deconz
    platform: device
    subtype: turn_on
    type: remote_button_short_press

(actualy that’s done by an automation switching a template light switching a scene switching an input boolean…)

Thanks

Thanks for your donation!

Is it possible to evaluate this in Schedy?

What do you mean by “evaluate”? Could you explain what you want to achieve in more detail? Even though I’m from Dresden I’ve never used deconz :slight_smile:

How to get the event in Schedy?

Shall I make a “momentary” input_boolean to reflect it or can I get the event directly…

I’d like to do something like "is_on(this button press event) ..." in a schedule