hass-agent / HASS.Agent

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

Bug: SetVolumeCommand action topic no longer working #173

Open wynandtredoux opened 2 months ago

wynandtredoux commented 2 months ago

Describe the bug After upgrading to 2.1.0 release, SetVolumeCommand no longer works through the action topic. If I set a value for "Volume", then HASS will set system volume to that value when the button is pressed in HomeAssistant. When Volume field is blank (so that value can be set dynamically), then the command does not run when an MQTT message is published to the action topic.

After reverting back to 2.1.0-beta1, everything works as expected again.

To Reproduce Steps to reproduce the behavior:

  1. Install or update to 2.1.0 release
  2. Click "Commands"
  3. Add new SetVolumeCommand
  4. Leave "Volume" field blank
  5. Store Command
  6. Store and Activate Commands -> new topic is created on MQTT server for SetVolumeCommand
  7. Publish value to action topic of the new command (in my case: homeassistant/button/NEW-DESK/NEW-DESK_setvolume/action)

I see that the action value is changed on the MQTT server (checked with MQTT Explorer), but HASS.Agent does not change the volume. Same result when adding SetVolumeCommand in satellite service.

Expected behavior Volume should be changed on PC

Misc info (please complete the following information):

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

Additional context After reverting back to the version I had installed previously (2.1.0-beta1), SetVolumeCommand works as expected. I did not try other 2.1.0 beta versions

Logs I can add logs if needed, but even with extended logging I don't see any log lines when system volume is changed with SetVolumeCommand. I only get a warning log line when the command is triggered as a button:

[WRN] [SETVOLUME] [setvolume] Unable to trigger command, it's configured as action-only

When publishing to setvolume/action, even when the command is working, nothing is logged to AppData\Local\HASS.Agent\Client\logs

drueppler commented 1 month ago

I might have the same issue, using 2.1.0.

I have lines like the following one in the log file, after the mqtt-publish from HA: 2024-10-04 00:54:01.928 +02:00 [ERR] [SETVOLUME] [volume] Unable to trigger command, the provided action value can't be parsed: 31.0

amadeo-alex commented 1 month ago

Ok, I've replicated this and those are actually:

Both can be solved. Should be fixed soon(TM) and will be part of 2.1.1.

amadeo-alex commented 1 month ago

If you're comfortable with betas, please try https://github.com/hass-agent/HASS.Agent/releases/tag/2.1.1-beta1 with the mentioned fix. Let me know in case of any issues.