hass-agent / HASS.Agent

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

Bug: Can't remove commands from Satellite Service #162

Open iamthekings5 opened 1 month ago

iamthekings5 commented 1 month ago

Describe the bug I can't remove commands from satellie service, after saving and reopening the commands aren't saved.

Expected behavior Commands should be saved.

Misc info

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

amadeo-alex commented 1 month ago

Hello, the title states that you cannot remove the commands but in the description you mention adding them. Could you please provide more details so I can understand it?

iamthekings5 commented 1 month ago

Hello, the title states that you cannot remove the commands but in the description you mention adding them. Could you please provide more details so I can understand it?

Hi,

Sorry for the conflicting information. I added 5 commands to the satellite service which was successful. I wanted to remove 2 of them, but am unable to do so. When I click save the commands appear to have been removed but reopening the commands window will show they are still there.

amadeo-alex commented 1 month ago

Could you please check the satellite logs for a line like this:

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

Default path for it is "C:\Program Files\HASS.Agent Satellite Service\Service", inside there should be "logs" folder and then the newest log file.

iamthekings5 commented 1 month ago

Here is my log, I tried to remove 3 of 5 commands saved:

2024-09-29 09:01:45.847 +01:00 [INF] [MAIN] Version: 2.1.0.0

2024-09-29 09:01:45.888 +01:00 [INF] [MAIN] Service started, initializing .. 2024-09-29 09:01:46.000 +01:00 [INF] [MAIN] Running as a service, initializing lifetime manager 2024-09-29 09:01:46.045 +01:00 [INF] [LIFETIMEMANAGER] Initialized 2024-09-29 09:01:46.116 +01:00 [INF] [WORKER] Startup completed, commencing execution .. 2024-09-29 09:01:49.028 +01:00 [INF] [SETTINGS] Config storage path: C:\Program Files\HASS.Agent Satellite Service\Service\config 2024-09-29 09:01:49.148 +01:00 [INF] [SETTINGS] Configuration loaded 2024-09-29 09:01:49.154 +01:00 [INF] [SETTINGS] MQTT configuration loaded 2024-09-29 09:01:49.160 +01:00 [INF] Application started. Hosting environment: Production; Content root path: C:\Program Files\HASS.Agent Satellite Service\Service\ 2024-09-29 09:01:49.173 +01:00 [INF] [SETTINGS_COMMANDS] Loaded 5 entities 2024-09-29 09:01:49.175 +01:00 [INF] [SETTINGS_SENSORS] Config not found, no entities loaded 2024-09-29 09:01:49.178 +01:00 [INF] [MQTT] Identifying as device: Laptop-Satellite 2024-09-29 09:01:49.197 +01:00 [INF] [MQTT] Connecting .. 2024-09-29 09:01:49.204 +01:00 [INF] [RPCMANAGER] Listening 2024-09-29 09:01:49.250 +01:00 [INF] [MQTT] Connected 2024-09-29 09:01:51.194 +01:00 [INF] [MQTT] Initial registration completed 2024-09-29 15:14:55.831 +01:00 [INF] [SYSTEMSTATE] Session ending: system shutting down 2024-09-29 15:14:55.834 +01:00 [INF] [SYSTEM] Service shutting down 2024-09-29 15:14:55.848 +01:00 [INF] [MQTT] Disconnected 2024-09-29 15:14:55.851 +01:00 [INF] [SYSTEM] Service shutdown complete 2024-09-29 15:14:56.330 +01:00 [INF] [WORKER] Halting .. 2024-09-29 15:14:56.352 +01:00 [INF] Application is shutting down... 2024-09-29 15:15:40.532 +01:00 [INF] [MAIN] Version: 2.1.0.0 2024-09-29 15:15:40.559 +01:00 [INF] [MAIN] Service started, initializing .. 2024-09-29 15:15:40.672 +01:00 [INF] [MAIN] Running as a service, initializing lifetime manager 2024-09-29 15:15:40.709 +01:00 [INF] [LIFETIMEMANAGER] Initialized 2024-09-29 15:15:40.756 +01:00 [INF] [WORKER] Startup completed, commencing execution .. 2024-09-29 15:15:43.754 +01:00 [INF] [SETTINGS] Config storage path: C:\Program Files\HASS.Agent Satellite Service\Service\config 2024-09-29 15:15:43.875 +01:00 [INF] [SETTINGS] Configuration loaded 2024-09-29 15:15:43.881 +01:00 [INF] [SETTINGS] MQTT configuration loaded 2024-09-29 15:15:43.891 +01:00 [INF] Application started. Hosting environment: Production; Content root path: C:\Program Files\HASS.Agent Satellite Service\Service\ 2024-09-29 15:15:43.903 +01:00 [INF] [SETTINGS_COMMANDS] Loaded 5 entities 2024-09-29 15:15:43.905 +01:00 [INF] [SETTINGS_SENSORS] Config not found, no entities loaded 2024-09-29 15:15:43.909 +01:00 [INF] [MQTT] Identifying as device: Laptop-Satellite 2024-09-29 15:15:43.929 +01:00 [INF] [MQTT] Connecting .. 2024-09-29 15:15:43.941 +01:00 [INF] [RPCMANAGER] Listening 2024-09-29 15:15:43.995 +01:00 [INF] [MQTT] Connected 2024-09-29 15:15:45.933 +01:00 [INF] [MQTT] Initial registration completed 2024-09-29 15:18:26.433 +01:00 [INF] [COMMANDSMANAGER] Processing 2 received command(s), deleting 5 command(s) .. 2024-09-29 15:18:26.450 +01:00 [INF] [COMMANDS] Command not removed, not activated: Shutdown 2024-09-29 15:18:26.450 +01:00 [INF] [COMMANDS] Command not removed, not activated: Restart 2024-09-29 15:18:26.450 +01:00 [INF] [COMMANDS] Command not removed, not activated: Sleep 2024-09-29 15:18:26.450 +01:00 [INF] [COMMANDS] Command not removed, not activated: Lock 2024-09-29 15:18:26.450 +01:00 [INF] [COMMANDS] Command not removed, not activated: hibernate 2024-09-29 15:18:26.468 +01:00 [INF] [COMMANDS] Modified command: Shutdown 2024-09-29 15:18:26.472 +01:00 [INF] [COMMANDS] Modified command: Restart 2024-09-29 15:18:26.528 +01:00 [INF] [SETTINGS_COMMANDS] Stored 5 entities

boydfields commented 1 month ago

I too am unable to remove commands. They reappear on closing/reopening window. I get around the issue by editing the json directly.

amadeo-alex commented 1 month ago

@iamthekings5 could you please test if editing the json works for you also like @boydfields mentioned? @boydfields after editing the file manually, is it still not possible to make any changes via the UI?

Of course manual editing is not a solution, I'm trying to wrap my head around of what could be causing it. Could you both please provide me with the sensors/commands config that you're working with?

iamthekings5 commented 1 month ago

@iamthekings5 could you please test if editing the json works for you also like @boydfields mentioned? @boydfields after editing the file manually, is it still not possible to make any changes via the UI?

Of course manual editing is not a solution, I'm trying to wrap my head around of what could be causing it. Could you both please provide me with the sensors/commands config that you're working with?

Hi,

After editing the json, stopping then starting the satellite service the commands were saved successfully.

These are the commands I am running in the satellite service, I do not have any sensors for now.

[ { "Id": "5d609822-97d6-4298-b41d-4d3206005e8c", "Name": "Shutdown", "EntityName": "Shutdown", "Type": "CustomCommand", "EntityType": "button", "Command": "shutdown /s /t 0", "KeyCode": 0, "RunAsLowIntegrity": false, "Keys": [] }, { "Id": "013b1d32-53a9-4843-957a-b7eeb643d282", "Name": "Restart", "EntityName": "Restart", "Type": "CustomCommand", "EntityType": "button", "Command": "shutdown /r /t 0", "KeyCode": 0, "RunAsLowIntegrity": false, "Keys": [] } ]