Johboh / hassalarm

Android app for integration with Hass.io as a sensor for the next scheduled alarm on the device
MIT License
62 stars 6 forks source link

Entity not available after HA restart #8

Closed MrAlfabet closed 4 years ago

MrAlfabet commented 4 years ago

After restarting HA it loses the sensor identity of hassalarm until I either turn my alarm on/off, change the time or start the hassalarm app and tap 'save and test'.

As I'm often tinkering with the system after my gf's gone to bed and has set her alarm, this presents a problem.

Is there any way to tackle this?

Johboh commented 4 years ago

Hi! This is outside of control for the Hassalarm app, and I think this is more a question for the Home Assistant community on how states are kept on restart. I'm guessing https://www.home-assistant.io/integrations/history/ together with https://www.home-assistant.io/integrations/recorder/ might solve this, but I'm not sure.

Johboh commented 4 years ago

I will add support for input_datetime. With that the value will persist.

MrAlfabet commented 4 years ago

Thank you! Any time frame / anything I can do to help?

Johboh commented 4 years ago

I'm done with the implementation, I just need to do some more testing. There will be a release this weekend.

MrAlfabet commented 4 years ago

Awesome! I'll keep my eye on the play store then.

Johboh commented 4 years ago

@MrAlfabet Version 1.5 is now pushed to Play Store.

MrAlfabet commented 4 years ago

I can't see it yet, but I'll keep an eye on it!

MrAlfabet commented 4 years ago

Do I have to do something special after updating? HA is still not remembering the instance after reboot.

Johboh commented 4 years ago

@MrAlfabet Can you confirm that:

  1. You followed the guide here on how to add an input_datetime input: https://github.com/Johboh/hassalarm/blob/master/README.md
  2. That you are using the input_datetime mode in the hassalarm app by setting the entity ID to the input you created in step 1, that is, input_datetime.next_alarm and that the entity ID is legacy sensor.. toggle is set to OFF.
  3. That you have working History and Recorder components enabled in Home assistant.
MrAlfabet commented 4 years ago

I have not installed History or Recorder, I think I misread your comment

I will add support for input_datetime. With that the value will persist.

As being that it's working now, even without history and recorder

MrAlfabet commented 4 years ago

I had to change the settings in the app as well, to date_time. instead of sensor. Got it working now, thanks!

Johboh commented 4 years ago

@MrAlfabet great! Sorry for any confusion.