Giter Club home page Giter Club logo

Comments (11)

stikonas avatar stikonas commented on June 15, 2024

hmm, I just enabled NTP on my neohub (in fact I port forwarded NTP requests to my local NTP server on my router). But I guess if you don't want NTP that would be fine...

from heatmiser-for-home-assistant.

ntompson avatar ntompson commented on June 15, 2024

What I should have added is that enabling NTP seems to be temporary - it corrects the clock at the time the call is made, but the clock drifts from that point onwards. So I find that I need to call NTP_ON every so often (maybe weekly) to keep it in check.

Oh, and {"NTP_ON": 0} activates NTP, rather than disabling it.

So it's not that I don't want NTP, it seems that this is the method necessary to keep NTP working.

from heatmiser-for-home-assistant.

stikonas avatar stikonas commented on June 15, 2024

So it's not that I don't want NTP, it seems that this is the method necessary to keep NTP working.

Hmm, interesting.... My experience was that time is not drifting away when NTP is enabled. If it happens on some hardware then something like this might make sense.

Maybe it's worth asking heatmiser support? They seem to be quite helpful.

from heatmiser-for-home-assistant.

ntompson avatar ntompson commented on June 15, 2024

That's a good suggestion - I'll drop them a note. I've started looking more closely at this. I find that my stats are losing something in the order of 10 seconds per day. An inspection of READ_DCB confirms that NTP has stopped after a time (I'm not sure how long it takes).

For example after two or three days:

$ date && python3 ./test-stat.py
Sat 21 Nov 17:04:35 AEDT 2020
json_request: {'READ_DCB': 100} 
json_response: {..., "DSTAUTO":false,"DSTON":false, ..., "NTP":"Stopped", ..., "TIME":"17:04:07","TIMEZONE":10.0,"TIMEZONESTR":"", ...} 

Then I run update DST and activate NTP, and it comes good:

date && python3 ./test-stat.py
Sat 21 Nov 17:05:22 AEDT 2020
json_request: {'MANUAL_DST': 1} 
json_response: {"result":"Updated time"} 
json_request: {'NTP_ON': 0} 
json_response: {"result":"ntp client started"} 
json_request: {'READ_DCB': 100} 
json_response: {..., "DSTAUTO":false,"DSTON":true, ... ,"NTP":"Running", ... ,"TIME":"17:05:04","TIMEZONE":10.0,"TIMEZONESTR":"", ...}

But a few days later, I will find NTP not running and the clocks starting to drift again.

Anyway, I'll come back if / when I get a response.

from heatmiser-for-home-assistant.

stikonas avatar stikonas commented on June 15, 2024

Maybe something was setting the time in the meantime?

Messing up with time (e.g. with SET_TIME call) sets NTP into "Stopped" state

from heatmiser-for-home-assistant.

ntompson avatar ntompson commented on June 15, 2024

On this occasion, you're probably right - I had been stuffing around a bit, so it's likely that the most recent thing I did was set the time manually in the app. I'll keep an eye on it over the next couple of days. NTP is still running today, and there hasn't been any clock drift. Trick here will be to catch what causes NTP to stop running (apart from me interfering).

from heatmiser-for-home-assistant.

ntompson avatar ntompson commented on June 15, 2024

Coming back to this, I think I've got a better idea of what's going on now. First some observations:

  • If I touch nothing, NTP runs reliably - at least it has done for the last 2-3 weeks
  • Any modification to time in the Heatmiser Neo app causes NTP to stop
  • There is no way to restart NTP from the app
  • The app provides no method to set / clear daylight savings
  • It's possible to set / clear DST through the API and not break NTP

So for geographies with daylight savings, I think we need something in the integration to help manage daylight savings, as there is no way for an ordinary user to do this without breaking NTP (other than sending commands through the API).

My suggestion is to offer a custom service in the integration to set / clear daylight saving as a custom HA service. The HA user could then create an automation to set / clear DST using the custom service in the Heatmiser integration, triggered at the appropriate time.

If we wanted to go a bit further, we could also:

  • Offer a custom service to set timezone (GMT offset) - anyone living outside the three app supported timezones is out of luck
  • Offer a custom service to start NTP

A better option for the second point might be to routinely start NTP as a hidden API call as part of the DST / timezone custom integration services - just in case the user has messed up NTP by setting the time through the Heatmiser app.

Interested in your thoughts.

from heatmiser-for-home-assistant.

stikonas avatar stikonas commented on June 15, 2024

Adding custom service sounds reasonable.

It seems that some other integrations also do that: https://github.com/home-assistant/core/blob/dev/homeassistant/components/ecobee/climate.py#L263

from heatmiser-for-home-assistant.

ntompson avatar ntompson commented on June 15, 2024

Nice one - that's a perfect example.

from heatmiser-for-home-assistant.

seanmccabe avatar seanmccabe commented on June 15, 2024

An ability to set the time would be awesome.
Whenever the thermostat loses connection to the hub, or the hub loses power, the time on the thermostat seems to reset to GST.
Not helpful when I'm in NZ on DST.

Only way to reset it is to go into the app, set the clock to GST (as it still shows NZ in there), wait a few minutes and set it back to NZ again.

from heatmiser-for-home-assistant.

ankohanse avatar ankohanse commented on June 15, 2024

While this is not yet in the MindrustUK code, I used the following workaround. Added it here because it might be usefull for others.

in configuration.yaml add:
shell_command: !include shell_commands.yaml

in shell_commands.yaml add:
neohub_sync_time: echo -e '{"NTP_ON":0}\x00\r' | nc 192.168.88.204 4242

in automations.yaml add:

- id: '1692600497550'
  alias: NeoHub Sync Time
  description: ''
  trigger:
  - platform: time_pattern
    hours: '00'
    minutes: '00'
    seconds: '00'
  condition: []
  action:
  - service: shell_command.neohub_sync_time
    data: {}
    response_variable: neohub_sync_time_response
  mode: single

Have not yet found a way to reset DST time zone back to NZ (am in New Zealand as well). For now, it seems to stick to its NZ value and not fall back to GST.

from heatmiser-for-home-assistant.

Related Issues (20)

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.