Comments (9)
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.
Noted. I will try to replicate the issue again with screenshots to better document what is happening and reply back.
from hass.agent.
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.
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!
from hass.agent.
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.
- Computer is put to sleep/lid closed -> status changes to Unavailable, as expected
- 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.
- If I lock and unlock my Session, state updates to Unlocked as expected.
I was able to reproduce the issue multiple times.
I did a second process where the issue did not show up:
- Computer is put to sleep/lid closed -> status changes to Unavailable, as expected
- 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).
- 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.
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.
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.
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.
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)
- Feature: Greek Language Translation
- Bug: not connecting to mqtt
- Bug: Intermittent Multikey Command Response
- MQTT disconnects randomly in Windows 11 HOT 1
- Stops Communicating HOT 1
- Misc: How to see battery on laptop when lid is closed
- Misc: MQTT running but all sensors showing as "Unknown" HOT 6
- Compatible with windows 7?
- Feature: /api/image_proxy/image.entity notifications HOT 3
- Bug: Paid Syncfusion components.
- Agent working BEFORE login? HOT 5
- Mediaplayer isnt working after name change HOT 1
- Bug: Hass Agent does not open
- Bug: Signature of installer is outdated
- Monitorwake does not release up button HOT 2
- Bug: Windows 11 notifications not popping up HOT 2
- Misc: LAB02-Research vs hass-agent.io HOT 3
- Greek Translation
- Misc: Help convert MB to GB HOT 4
- Feature:
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hass.agent.