Code Monkey home page Code Monkey logo

Comments (9)

LAB02-Admin avatar LAB02-Admin commented on May 26, 2024 2

That really helps a lot, and actually gave me an idea to make all sensors more reliable. I'll write it out here so I won't forget:

Currently sensors only send their value, when the value has changed compared to last round. This takes away some pressure from the mqtt broker. However, in this case, hass.agent thinks it sent the value while in fact HA hasn't received it.

I have implemented a feature which forces all sensors to resend their value after a disconnection, but apparently that doesn't get properly registered in this case.

So, the idea: I'll use the HA API to fetch the current state of the sensor, in other words, what HA thinks the current value is. If that value differs from the actual value, force resend the value.

This way, the values should always stay in sync between HA and hass.agent.

from hass.agent.

cromelex avatar cromelex commented on May 26, 2024 1

Noted. I will try to replicate the issue again with screenshots to better document what is happening and reply back.

from hass.agent.

LAB02-Admin avatar LAB02-Admin commented on May 26, 2024 1

Great, thanks for being so observant!

I've changed to title to remind me of the sync-sensor-state idea, which I'll still implement to be 100% sure of correctly reported sensorstates.

from hass.agent.

LAB02-Admin avatar LAB02-Admin commented on May 26, 2024

Hi @cromelex,

Thanks for reporting this. HASS.Agent uses different code for retrieving the session state than hass-workstation-service. The issue you linked regards the session changing id, and that doesn't seem to be the case here.

I'll look into it!

hassagent-5

from hass.agent.

cromelex avatar cromelex commented on May 26, 2024

Okay, some feedback.

As my laptop is docked (via USB-C for display and wired network), it looks like it is taking 30-60s for the network connection to be fully established, not sure if this is impacting the timing of the sensor update:
I have my SessionState sensor set to update every 10s which was the default.

  1. Computer is put to sleep/lid closed -> status changes to Unavailable, as expected
  2. Computer lid is opened and Windows login is done via Windows Hello within a couple of seconds -> sensor status takes up to 30/60s to update, and then updates to Locked.

session state locked

  1. If I lock and unlock my Session, state updates to Unlocked as expected.

session state unlock after

I was able to reproduce the issue multiple times.

I did a second process where the issue did not show up:

  1. Computer is put to sleep/lid closed -> status changes to Unavailable, as expected
  2. Computer lid is opened, I wait 30/60s with the screen locked until the sensor status changes to Locked (as checked from a 3rd device).
  3. Computer is unlocked -> Status changes to Unlocked within 10s, as expected.

So the issue actually seems to relate to the timing of the Locked->Unlocked status change,

Hope this helps.
Thanks

from hass.agent.

cromelex avatar cromelex commented on May 26, 2024

Can i just double check that you made something to fix this on the latest release?
Just checked my Home Assistant logs and it looks like the issue hasn't happened in 3 days, which I think matches when I did the update to the latest release.
Thanks

from hass.agent.

LAB02-Admin avatar LAB02-Admin commented on May 26, 2024

Hey @cromelex, you're on the stable release channel, so v2022.3.27?

A lot changed there yea, almost the entire code base - but I didn't fix this bug on purpose. So if it's fixed, that's a happy coincidence :p

from hass.agent.

cromelex avatar cromelex commented on May 26, 2024

Yes, I can confirm I'm on stable release, v2022.3.27.

Running the sensor as local (not using the sattelite service for now, as only 1 user on my laptop).
I had a closer look at the logs and it really seems to be fixed, even if it was a happy coincidence.

As far as I am concerned you can close this bug as resolved (even if by coincidence).

Thanks

from hass.agent.

LAB02-Admin avatar LAB02-Admin commented on May 26, 2024

I'm closing most feature requests from github's issue list. They're not ignored, just moved to the HASS.Agent Issue Tracker (you can find your link in a comment above).

That tracker allows me to organise better through what's pending, being done, being released, etc. - instead of one long list, which is beginning to stress me out :p

I will however post a reply here when I've implemented your request, and feel free to still post here when you have any questions/additions.

from hass.agent.

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.