GithubHelp home page GithubHelp logo

hass-persistence's People

Contributors

gazoscalvertos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

hass-persistence's Issues

Values are being retained, but input_numbers no longer work (sliders)

Hey,
Thanks for this component, it's something that HA really misses.
(at least i cant get restore_state to work)

I have enabled your component on several input_number entities,
After restart the values are retained but they no longer react as sliders.
There is no line to drag next to them, and in the states page, i get the name and state correct, but blank attributes.

Here is the sensor i have enabeld:

 - platform: persistence
    entities:
       - input_number.irrigation_routine_1_start_hour
       - input_number.irrigation_routine_1_zone_1_min
       - input_number.irrigation_routine_1_zone_2_min
       - input_number.irrigation_routine_1_zone_3_min
       - input_number.irrigation_routine_1_zone_4_min
       - input_number.irrigation_routine_1_zone_5_min

And sample of my input_number code:

  irrigation_routine_1_zone_1_min:
    name: Zone 1 Timer
    initial: 0
    min: 0
    max: 20
    step: 1
    unit_of_measurement: m
    mode: slider
    icon: mdi:timer
    

ANy ideas?
Thanks in advance

Error doing job: Future exception was never retrieved

After implementing hass-persistence I continuously get errors like the one below:


Sun May 20 2018 07:26:55 GMT+0200 (W. Europe Daylight Time)

Error doing job: Future exception was never retrieved

Traceback (most recent call last):
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/pi/.homeassistant/custom_components/sensor/persistence.py", line 99, in state_change_listener
    self._persistence_list[event.data['entity_id']] = event.data.get('new_state', None).state
TypeError: list indices must be integers or slices, not str

Running Home-assistant 0.69.0

Relevant configurtation.yaml:

sensor:
  - platform: persistence
    entities: #ADD ALL OF YOUR ENTITIES HERE
      - counter.doorbell_counter
      - counter.dryer_counter
      - counter.frankaway_counter
      - counter.jetaway
      - counter.toilet_counter
      - counter.washmachine_counter
      - light.badkamer_lamp
      - light.badkamer_spiegel
      - light.bank_licht
      - light.eettafel
      - light.gang
      - light.gang_boven
      - light.gang_zolder
      - light.keuken
      - light.kledingkamer
      - light.lieke_grote_lamp
      - light.lieke_kleine_lamp
      - light.rommelhok
      - light.schuur_binnenverlichting
      - light.schuur_buitenverlichting
      - light.slaapkamer_frank_en_jet
      - light.toilet
      - light.tv_licht
      - light.wasmachinehok
      - light.werkkamer_lamp
      - light.werkkamer_spots
      - light.yeelight_rgb_7811dc6ba370
      - sensor.boiler_mean
      - sensor.boilerdaily_mean
      - sensor.dryer_mean
      - sensor.dryerdaily_mean
      - sensor.gas_consumption
      - sensor.hourly_gas_consumption
      - sensor.mqttdailykwhboiler
      - sensor.mqttdailykwhdryer
      - sensor.mqttdailykwhtotal
      - sensor.mqttdailykwhtv
      - sensor.mqttdailykwhwashing_machine
      - sensor.mqtthourlykwhboiler
      - sensor.mqtthourlykwhdryer
      - sensor.mqtthourlykwhtotal
      - sensor.mqtthourlykwhtv
      - sensor.mqtthourlykwhwashing_machine
      - sensor.total_mean
      - sensor.totaldaily_mean
      - sensor.tv_mean
      - sensor.tvdaily_mean
      - sensor.washing_machine_mean
      - sensor.washing_machinedaily_mean

Breaks friendly names

Testing this interesting plugin, it appears to break Friendly name of input booleans.

One of my booleans "input_boolean.night" shows up on the Home dash as "night" after a restart using persistence, instead of with its friendly name "Night mode".

Compatibility with 0.92

As the structure of the custom components has changed since HA version 0.92 the component needs some refactoring.
Thanks

State restoration incorrect and some other issues....

I'm still learning Python and HASS. Tried your persistence sensor (thank you). Have some suggestions based on errors I saw. There are timing issues because multiple threads are running, so don't know if this is comprehensive or not or if the solutions are proper....

  1. declare self._persistence_list as a dictionary vs. list.
  2. limit the restoration of a state to just the state value otherwise the whole state (like icon, friendly name) is cleared. Replace self._hass.states.set(key,val) with
    state_temp = self._hass.states.get(key);
    self._hass.states.set(key,val,state_temp.attributes)
  3. I've had timing issues where the initial state of an entity is saved before the persistence_load has had a chance to run, thus overwriting the "persisted" values with the initial values. I changed the first line of persistence_save to check if self._initialised has completed otherwise the update is ignored-- if self._persistence_list is not None and self._initialised

Thanks again for this effort.

Breaks home alarm from being able to enable/disable

First off, thank you so much for this! Been highly annoyed that my alarm will revert to disarmed on a reboot. Found a bug though. Whenever I enable this, it prevents me from being able to arm/disarm the alarm. As soon as I comment out the sensor, I'm able to set the alarm again. Not sure what's causing this. It also goes from "Home Alarm" to "home alarm" on my home screen.

With persistence sensor enabled:

image
image

Without persistence sensor enabled:
image
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.