Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Startup automation error #18

Closed
Bram1nat0r opened this issue May 9, 2019 · 2 comments
Closed

Startup automation error #18

Bram1nat0r opened this issue May 9, 2019 · 2 comments

Comments

@Bram1nat0r
Copy link

Bram1nat0r commented May 9, 2019

Hi,

First of all, hats off to you!! Another good use of my Google Assistant!
Works like a charm. Still need time to figure out, how to start translating everything to Dutch.
Anyhow :
I've gone through the closed thread: Error in automation? opened on Feb7 (not sure if I can re-open this..?), because I'm getting the same error at Hassio startup.

Error while executing automation automation.lms_gui_update_player_values. Invalid data for call_service at pos 2: expected float for dictionary value @ data['value']

The entity : sensor.raw_volume returns : 30 mixer%20bass%3A0 mixer%20treble%3A0

Did your troubleshoot tips, and I found one player that returns that strange string value for "volume":

Player information:

Player Model: Squeezebox Boom
Player Type: boom
Firmware: 57
Player IP Address: 192.168.XXX.XXX
Player MAC Address: 00:04:20:1e:d9:99

bash-4.4# bash qry_player_stat.sh 00:04:20:1e:d9:99
lms_username is: null
login is: not required and lms_secure is: 0
HA Token is: XXXXXXXXXX
My Domain is: XXXX.XXXX.XXXX:XXXX
My lms_ip: 192.168.XXX.XXX
My lms_cli_port: 9090

Query is: 00%3A04%3A20%3A1e%3Ad9%3A99 status player_name%3AZolder%20Achterkamer%20Squeezebox player_connected%3A1 player_ip%3A192.168.XXX.XXX%3A35453 power%3A0 signalstrength%3A0 mode%3Astop remote%3A1 current_title%3A time%3A248.512169057846 rate%3A1 duration%3A264.293 mixer%20volume%3A30 mixer%20bass%3A0 mixer%20treble%3A0 playlist%20repeat%3A0 playlist%20shuffle%3A0 playlist%20mode%3Aoff seq_no%3A0 playlist_cur_index%3A9 playlist_timestamp%3A1557156981.99936 playlist_tracks%3A10 digital_volume_control%3A1 remoteMeta%3AHASH(0xfbdff38)
No Sleep Parameter Found - setting to 0
volume:30 mixer%20bass%3A0 mixer%20treble%3A0
shuffle:Off
repeat:Off
sleep:0
{"attributes": {}, "context": {"id": "f74f479373eb44ba9d1374b20478f4c6", "parent_id": null, "user_id": "dda06aac0709441dadbed8a375df61c9"}, "entity_id": "sensor.raw_volume", "last_changed": "2019-05-09T14:54:19.357134+00:00", "last_updated": "2019-05-09T14:54:19.357134+00:00", "state": "76"}
{"attributes": {}, "context": {"id": "49d7327014da4e42aa8a03f7e6ea1658", "parent_id": null, "user_id": "dda06aac0709441dadbed8a375df61c9"}, "entity_id": "sensor.raw_shuffle", "last_changed": "2019-05-09T13:29:53.496936+00:00", "last_updated": "2019-05-09T13:29:53.496936+00:00", "state": "Off"}
{"attributes": {}, "context": {"id": "2840f2f4a93c474c9758ceca4d0bef4d", "parent_id": null, "user_id": "dda06aac0709441dadbed8a375df61c9"}, "entity_id": "sensor.raw_repeat", "last_changed": "2019-05-09T13:29:53.638447+00:00", "last_updated": "2019-05-09T13:29:53.638447+00:00", "state": "Off"}
{"attributes": {}, "context": {"id": "0114c6cf6f8246d9bee80db3781884a5", "parent_id": null, "user_id": "dda06aac0709441dadbed8a375df61c9"}, "entity_id": "sensor.raw_sleep", "last_changed": "2019-05-09T13:29:53.797022+00:00", "last_updated": "2019-05-09T13:29:53.797022+00:00", "state": "0"}

Any idea what's the problem?

@ynot123
Copy link
Owner

ynot123 commented May 9, 2019

Yep, I think so. Thanks for the full output makes troubleshooting much easier. The problem seems to lie in the trim command that strips out the volume number from the player status. The squeezebox boom supports additional settings that many other players don't like bass and treble and these are being returned as well. So to fix, in the shell script qry_player_stat.sh try replacing the following line:

raw_volume=${raw_volume%% playlist%20repeat*}
with
raw_volume=${raw_volume%% *}

That will effectively strip out (or trim) all characters after the space following the word "volume" which in your example should now leave you with "30"

Let me know if that solves your problem. Should work for all players so will likely post that as an update in the near future. Ynot.

@Bram1nat0r
Copy link
Author

Hi Ynot,
Thanks for the quick reply. I changed the trim command as you said, and this solved the issue.
No more errors in the log, and the sensor.raw_volume entity is nicely set to an integer.

@ynot123 ynot123 closed this as completed May 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants