[WIP] MQTT Support / Home Assistant Integration#1195
[WIP] MQTT Support / Home Assistant Integration#1195PH89 wants to merge 6 commits intojetkvm:devfrom
Conversation
|
@PH89 I've tested this on my JetKVM device and it seems to work well - I'll play around with it next week to see if I spot any issues. I wonder if there's a simple way to add a debounce delay for certain things like ATX HDD LED which can flick on and off repeatedly/quickly for long read/write sessions (if I'm using my NAS, this spams my broker and Home Assistant 😅). |
|
I will check this out. Normally it should be possible. But should be configurable. For MQTT server it should not be a problem to handle such change frequency. On the Home Assistant site it could cause a quick pollution of the history log. So maybe it is better to disable logging for these entities. |
1be2637 to
6aa24d5
Compare
|
@Igglybuff Integrated debounce delay for ATX HDD Led. |
…n be executed. When disabled, controllable entities (switches, buttons, select) are replaced with read-only sensors/binary sensors. The firmware update entity remains visible but without install capability. - Fix update entity progress feedback by removing value_template which prevented HA from parsing in_progress/update_percentage fields. Add updateRequested flag and lastKnownLatestVersion cache to bridge the gap between MQTT command and OTA state transitions. - Add system metrics sensors: CPU Load (with state_class measurement for graphs), SoC Temperature, Memory Used, Storage Used, Storage Free. - Add Virtual Media select entity with dynamic options list, mount/unmount support, source attribute (url/storage)
…s too flaky states in HA. - Changes on entities like mouse jiggler, virtual media, or active sessions are now published to MQTT instantly. Previously, these changes only appeared in Home Assistant after the next periodic update cycle. Additionally, all current states (ATX/DC, jiggler, virtual media, sessions, network, system, video, etc.) are now published immediately when the MQTT connection is first established, so Home Assistant knows the full device state right away on startup or reconnect. - Also fixes slow session disconnect detection: ICE 'Disconnected' state now triggers an immediate connection close instead of waiting for the ICE timeout (5-30s) before transitioning through 'Failed' to 'Closed'.
I've just tested your branch and played around with the debounce setting, but I'm not sure it's behaving as expected. No matter what value I set it to (500, 1000, 0), the ATX HDD LED sensor is stuck disabled:
Though this could be because I need to start fresh and re-register with my broker? Not sure. Were there any other features you were thinking of adding? I would be curious to hear what the JetKVM maintainers think of this PR - maybe they don't look at drafts 😄 |
|
Actually I think the debounce is working now (PEBKAC error) - I had it disabled from a couple weeks ago, but for some reason it took a few attempts for Home Assistant to enable it again and for the entity state to start populating. This shouldn't be a problem when setting it up for the first time I don't think. |
|
I've been testing this, and all seems to work great. The only issue I've noticed on reboot of the jetkvm it doesn't reconnect to MQTT and requires the save & connect to be selected |
|
Thanks for the feedback. I will check on this. I guess I will finalise the PR this weekend and mark it as ready for review. |

Summary
rootcertsand optional insecure modeEnableActionsconfig toggle — when disabled, controllable entities are replaced with read-only sensors/binary sensors while keeping full monitoring capability. The firmware update entity remains visible but without install command.in_progressstatus andupdate_percentageduring OTA updatessourceattribute (storage/url/none)state_class: measurementfor graphs), SoC temperature, memory usage, storage used/freeRelated Issues:
Test plan
EnableActionsoff → confirm switches become binary sensors, buttons disappear, select becomes sensor, update entity loses install buttonEnableActionson → confirm controllable entities reappearsourceattribute isurlPreview