hass-agent / HASS.Agent

Unofficial development project for the HASS.Agent platform.
https://hass-agent.io
MIT License
399 stars 12 forks source link

Bug: Unable to create or change satellite service commands 'Sleep' and 'Shutdown' #172

Open andjo opened 1 month ago

andjo commented 1 month ago

Describe the bug Can't create Shutdown or Sleep commands in the satellite service. It appears to be working, but after reopening the configuration they are gone and there is an indication of why in the log.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Satellite Service Configuration' -> 'Commands'
  2. Click on 'Add New'
  3. Select 'Sleep' or 'Shutdown'
  4. 'Store Command'
  5. 'Send & Activate Commands'
  6. After closing and reopening the configuration they are not there.
  7. Se error in log below

Expected behavior Sleep and Shutdown command present and working.

Screenshots image

Misc info (please complete the following information):

Please check what's applicable (multiple answers possible):

Additional context Modifying existing commands from previous version also did not work as expected, so I removed them and tried to recreate.

162 might be related.

Logs

2024-09-28 16:47:00.383 +02:00 [INF] [MAIN] Version: 2.0.1.0
2024-09-28 16:47:00.403 +02:00 [INF] [MAIN] Service started, initializing ..
2024-09-28 16:47:00.504 +02:00 [INF] [MAIN] Running as a service, initializing lifetime manager
2024-09-28 16:47:00.540 +02:00 [INF] [LIFETIMEMANAGER] Initialized
2024-09-28 16:47:00.568 +02:00 [INF] [WORKER] Startup completed, commencing execution ..
2024-09-28 16:47:00.892 +02:00 [INF] [SETTINGS] Config storage path: C:\Program Files\HASS.Agent\Service\config
2024-09-28 16:47:00.963 +02:00 [INF] [SETTINGS] Configuration loaded
2024-09-28 16:47:00.967 +02:00 [INF] [SETTINGS] MQTT configuration loaded
2024-09-28 16:47:00.975 +02:00 [INF] Application started. Hosting environment: Production; Content root path: C:\Program Files\HASS.Agent\Service\
2024-09-28 16:47:00.977 +02:00 [INF] [SETTINGS_COMMANDS] Loaded 0 entities
2024-09-28 16:47:00.979 +02:00 [INF] [SETTINGS_SENSORS] Config not found, no entities loaded
2024-09-28 16:47:00.985 +02:00 [INF] [MQTT] Identifying as device: LEGION_7-satellite
2024-09-28 16:47:00.998 +02:00 [INF] [MQTT] Connecting ..
2024-09-28 16:47:01.025 +02:00 [INF] [RPCMANAGER] Listening
2024-09-28 16:47:01.045 +02:00 [INF] [MQTT] Connected
2024-09-28 16:47:03.010 +02:00 [INF] [MQTT] Initial registration completed
2024-09-28 16:47:16.787 +02:00 [INF] [COMMANDSMANAGER] Processing 2 received command(s), deleting 0 command(s) ..
2024-09-28 16:47:16.792 +02:00 [ERR] [SETTINGS_COMMANDS] [sleep] Unknown configured command type: RadioCommand
2024-09-28 16:47:16.792 +02:00 [ERR] [SETTINGS_COMMANDS] [shutdown] Unknown configured command type: WebViewCommand
2024-09-28 16:47:16.802 +02:00 [INF] [SETTINGS_COMMANDS] Stored 0 entities
amadeo-alex commented 1 month ago
2024-09-28 16:47:16.792 +02:00 [ERR] [SETTINGS_COMMANDS] [sleep] Unknown configured command type: RadioCommand
2024-09-28 16:47:16.792 +02:00 [ERR] [SETTINGS_COMMANDS] [shutdown] Unknown configured command type: WebViewCommand

That's interesting to say the least? Investigating :)

amadeo-alex commented 1 month ago

I couldn't replicate this so I took a look at the logs again

2024-09-28 16:47:00.383 +02:00 [INF] [MAIN] Version: 2.0.1.0

What we should see is

2024-09-29 15:28:14.442 +02:00 [INF] [MAIN] Version: 2.1.0.0

That means the client and satellite version is not matching, did you install the satellite service while doing upgrade? (The second installer). I might have a clue of what happened but need to ask some questions to confirm it.

andjo commented 1 month ago

Yes.

image

Tried to update again, and it appears like the service is installed, but what I have in C:\Program Files\HASS.Agent\Service\ is still 2.0.1. Is there an installation log somewhere?

andjo commented 1 month ago

Ah, I see it has changed location. The old service is still the one running though.

amadeo-alex commented 1 month ago

When you upgrade the old service should be replaced by a new one (old from the fork, the forked HASS.Agent won't touch the original one so if both of them will be there and only one should be running) You went from 2.0.1 straight to 2.1.0 or from one of the original versions?

andjo commented 1 month ago

I have been using the fork for a while now, and upgraded from 2.0.1 to 2.1.0.

andjo commented 1 month ago

Resolved the issue by uninstalling both "HASS.Agent" and "HASS.Agent Satelite Service" via windows settings. Then downloading the 2.1.0 release manually and installing that from scratch.

After that I could again reproduce the issue by uninstalling everything, installing 2.0.1 from scratch, and running the update via "Check for update".

Funny observation after the upgrade:

image

🤷

amadeo-alex commented 1 month ago

Thank you for the information I'll try to replicate this.