bob1de / hass-apps

Some useful apps and snippets to empower Home Assistant and AppDaemon even more.
Apache License 2.0
86 stars 23 forks source link

[heaty] Error: expected float for dictionary value @ data['off_temp'] #7

Closed mradziwo closed 6 years ago

mradziwo commented 6 years ago

I have tried to set-up a heaty inscance on my machine and I have hit the problem at startup.

My settings are:

Heaty: heaty v0.12.0 Home Assistant: 0.61.1 AppDaemon Version 3.0.0b4

app.yaml

heaty:
  # Obligatory settings that tell appdaemon where to find the app.
  # You shouldn't need to change these two.
  module: hass_apps_loader
  class: HeatyApp

  debug: true 

  rooms:
    # Define such a block for each room you want to control.
    living:
      thermostats:
        climate.study:
          opmode_heat: "heat"
          opmode_off: "off"
      schedule:
      # From Monday to Friday, set temperature to 20.5 °C from 7.45 am
      # to 10.00 pm.
      - { temp: 21.5, start: "07:45", end: "22:00", weekdays: 1-5 }
      # On weekends, set temperature to 20.5 °C from 8.15 am to 11.30 pm.
      - { temp: 20.5, start: "08:15", end: "23:30", weekdays: "6,7" }
      # At all other times, set temperature to 16 °C.
      - { temp: 16 } 

AppDaemon STDout:

2018-03-04 20:38:39.853500 INFO AppDaemon: Reading config
2018-03-04 20:38:39.865516 INFO AppDaemon: /conf/apps/apps.yaml added or modified
2018-03-04 20:38:39.865809 INFO AppDaemon: App 'heaty' changed
2018-03-04 20:38:39.866322 INFO AppDaemon: Terminating heaty
2018-03-04 20:38:39.866671 INFO AppDaemon: Initializing app heaty using class HeatyApp from module hass_apps_loader
2018-03-04 20:38:39.867797 INFO heaty: --- heaty v0.12.0 initialization started

AppDaemon STDError:

2018-03-04 20:38:39.869361 WARNING AppDaemon: ------------------------------------------------------------
2018-03-04 20:38:39.869649 WARNING AppDaemon: Unexpected initializing app: heaty:
2018-03-04 20:38:39.869939 WARNING AppDaemon: ------------------------------------------------------------
2018-03-04 20:38:39.870448 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 1927, in check_app_updates
    self.init_object(app)
  File "/usr/local/lib/python3.6/site-packages/appdaemon/appdaemon.py", line 1477, in init_object
    self.objects[name]["object"].initialize()
  File "/usr/local/lib/python3.6/site-packages/hass_apps/common.py", line 86, in initialize
    self.cfg = self.Meta.config_schema(cfg)  # pylint: disable=not-callable
  File "/usr/local/lib/python3.6/site-packages/voluptuous/schema_builder.py", line 267, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.6/site-packages/voluptuous/validators.py", line 204, in _run
    return self._exec(self._compiled, value, path)
  File "/usr/local/lib/python3.6/site-packages/voluptuous/validators.py", line 284, in _exec
    raise e if self.msg is None else AllInvalid(self.msg)
  File "/usr/local/lib/python3.6/site-packages/voluptuous/validators.py", line 282, in _exec
    v = func(path, v)
  File "/usr/local/lib/python3.6/site-packages/voluptuous/schema_builder.py", line 769, in validate_callable
    return schema(data)
  File "/usr/local/lib/python3.6/site-packages/voluptuous/schema_builder.py", line 267, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.6/site-packages/voluptuous/schema_builder.py", line 587, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.6/site-packages/voluptuous/schema_builder.py", line 425, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: expected float for dictionary value @ data['off_temp']

2018-03-04 20:38:39.871782 WARNING AppDaemon: ------------------------------------------------------------
mradziwo commented 6 years ago

in your thread at: https://community.home-assistant.io/t/heaty-a-flexible-heating-control-facilitating-schedules-and-manual-interv

You have mentioned you'd prefer getting issues posted here rather on forum.

Could I kindly ask whether I did something incorrect with posting this issue here? Is the problem resolved?

bob1de commented 6 years ago

No, you did everything perfectly right.

The issue has been closed automatically because I resolved it in a commit. :-) I also created a bugfix release (0.12.1) which you can upgrade to.

Thanks for reporting!

Best regards Robert

mradziwo commented 6 years ago

unfortunately

pip install --upgrade pip setuptools wheel
pip install --upgrade hass_apps

dodn't made any resolution. Should one set it up directly from your repository rather than form pip?

Wouldn't then be a good idea to make a dedicated docker for hass_apps ? It could easily expose appdeamon config file, while making sure newest builds are intact and in place.

bob1de commented 6 years ago

Have you restarted appdaemon? Does the appdaemon log show Heaty to be version 0.12.1?

Creating a docker image containing nothing more than hass_apps wouldn't make sense, since you need to have appdaemon in the same environment as hass_apps. I wrote about it in the Getting started section.

bob1de commented 6 years ago

BTW, having installed hass_apps in a separate virtualenv allows for really easy upgrading without influencing other applications.

mradziwo commented 6 years ago

my carelessnes.. after restart of appdaemon I've got it correct: 2018-03-05 20:19:03.956663 INFO heaty: --- heaty v0.12.1 initialization started I would made a discussion on whether having dedicated docker makes no sense. I see a perfect sense in having an isolated container serving purpose of hass_apps. Even with bare dedicated instance of appdaemon - as those applications are strongly entangled.

The actual important question is in how it will possibly fit hassio - as it seems to be the main direction now. I personally still run good'n'old home assistant on server.

bob1de commented 6 years ago

hass_apps isn't coupled to appdaemon more than any other app you'd might write yourself. I'm strongly against running multiple appdaemon instances, each serving just a single app. You'd also run into problems when using the dashboard component, because state publishing from inside an app isn't distributed among different appdaemon instances.

I'm not planning to use hassio in the foreseeable future, because I find it to be too restricted for my needs. I want to be able to swap out libraries and components as I develop, and a well-organized virtualenv setup fits really well to this purpose.

BTW, I filed an issue for appdaemon, proposing adding a config variable to the dockerfile in order to specify python packages to install/upgrade when appdaemon starts. It was accepted, but I don't know when it will get integrated.

mradziwo commented 6 years ago

My error, I should have named it "depend on" rather than coupled - which infers cross dependences. It indeed may be in internal workings of appdeamon that it's not suitable for multiple instantiation - my experience does not reach there.

Would not support for RPC (remote procedure call like grpc's of google) be a better approach to add in appdaemon? Then with provision of interface declaration and pointer in config, one could invoke nearly arbitrary code in other computing instance f.ex. dedicated docker containing hass_apps. It's just a long throw idea, but what do you think about it?

Best regards, Michał Radziwon

On 5 March 2018 at 21:53, Robert Schindler notifications@github.com wrote:

hass_apps isn't coupled to appdaemon more than any other app you'd might write yourself. I'm strongly against running multiple appdaemon instances, each serving just a single app. You'd also run into problems when using the dashboard component, because state publishing from inside an app isn't distributed among different appdaemon instances.

I'm not planning to use hassio in the foreseeable future, because I find it to be too restricted for my needs. I want to be able to swap out libraries and components as I develop, and a well-organized virtualenv setup fits really well to this purpose.

BTW, I filed an issue for appdaemon, proposing adding a config variable to the dockerfile in order to specify python packages to install/upgrade when appdaemon starts. It was accepted, but I don't know when it will get integrated.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/efficiosoft/hass_apps/issues/7#issuecomment-370561505, or mute the thread https://github.com/notifications/unsubscribe-auth/AI1rE2U3ClxweWuiC6FSO0RpuDzcBtqOks5tbaXlgaJpZM4SbfZ0 .

bob1de commented 6 years ago

I don't know GRPC's. But I think you make things more complicated than they actually are. You are of course free to build your own docker image with appdaemon + hass_apps if you really think it would help you manage dependencies better. But you could also just run pip install --upgrade hass_apps on every appdaemon startup.

bob1de commented 6 years ago

Don't get me wrong. Docker is cool and really useful. But I simply don't use it for home automation and thus won't provide an image for hass_apps.

mradziwo commented 6 years ago

fine and done... thanks for interesting dispute.

Have a nice evening!

Best regards, Michał Radziwon

On 5 March 2018 at 22:23, Robert Schindler notifications@github.com wrote:

Don't get me wrong. Docker is cool and really useful. But I simply don't use it for home automation and thus won't provide an image for hass_apps.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/efficiosoft/hass_apps/issues/7#issuecomment-370570664, or mute the thread https://github.com/notifications/unsubscribe-auth/AI1rE-3Z7fUEXFzlC8yGAnVMoqS3jeHRks5tbay_gaJpZM4SbfZ0 .

bob1de commented 6 years ago

You seem to be familiar with using Docker. Maybe you'd like to share your image with others? If you'd like to do so, I could mention it in the docs if you want me to.

I'd really like to have contributed more to the dispute, but I'm neither an appdaemon nor a docker expert. Maybe people find it useful to have both bundled into one image.

bob1de commented 6 years ago

I just thought about it again. How about waiting for this one to be implemented?

https://github.com/home-assistant/appdaemon/issues/235

One could then easily create a custom number of containers, each running just one single app, configurable with just a single variable. Even specifying a strict version to install is possible.

mradziwo commented 6 years ago

Thanks for link! That's definitely a interesting way to go.

Best regards, Michał Radziwon

On 6 March 2018 at 11:12, Robert Schindler notifications@github.com wrote:

I just thought about it again. How about waiting for this issue one to be implemented?

home-assistant/appdaemon#235 https://github.com/home-assistant/appdaemon/issues/235

One could then easily create a custom number of containers, each running just one single app, configurable with just a single variable. Even specifying a strict version to install is possible.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/efficiosoft/hass_apps/issues/7#issuecomment-370731678, or mute the thread https://github.com/notifications/unsubscribe-auth/AI1rE2XeDd2tzYHPxbDk7uN-12KBXZyPks5tbmEhgaJpZM4SbfZ0 .