kalimeroo wrote: 
> Hi,
> 
> I am running Hassbian with Home Assistant v0.83.2. 
> 
> When running the qry_alb.sh script it returns successfully the ID number
> of the artist and album (LMS server is not secured as far as I know).
> 
> The issue is on the curl POST request which returns the error 401. 
> 
> I tested :
> 
> $ curl -X POST -H "Authorization: Bearer ABCDEFGH" \
> -H "Content-Type: application/json" \
> -d '{"state": "25", "attributes": {"unit_of_measurement": "°C"}}'
> \
> http://localhost:8123/api/states/sensor.kitchen_temperature
> 
> and this worked out fine so I tryed modifying yout curl request but this
> resulted in "curl illegal port number" and error 405

Below is the proposed shell script mods to accommodate the long lived
token:

Code:
--------------------
    HA_token=ThisIsMyLongLivedToken
  curl -X POST -d '{"state":"'"${art_id}"'"}' 
https://HA_Link.duckdns.org/api/states/sensor.art_ID? -H "Authorization: Bearer 
$HA_token"
  echo
  curl -X POST -d '{"state":"'"${alb_id}"'"}' 
https://HA_Link.duckdns.org/api/states/sensor.alb_ID? -H "Authorization: Bearer 
$HA_token"
  echo
  curl -X POST -d '{"state":"'"${name}"'"}' 
https://HA_Link.duckdns.org/api/states/sensor.lms_name? -H "Authorization: 
Bearer $HA_token"
  echo
--------------------

Give that a shot.  
Ynot



*software* - logitech media server version: 7.9.1, home assistant
0.75.3, dialogflow - v.2 api, lms controls app - voice control of lms, 
openmediavault 4.1.9 - storage
*add-ons* - spotty, upnp / dlna bridge, chromecast bridge, 
*players* - sonos, upnp, pi3 - pi core player 3.5.0, android- sb player
v1.4.0, airplay to googlehome and minis
*hardware* - server - i7-3.4ghz, 4gb ram, 6tb storage, debian - 4.16.5
------------------------------------------------------------------------
ynot1234567890's Profile: http://forums.slimdevices.com/member.php?userid=66569
View this thread: http://forums.slimdevices.com/showthread.php?t=109273

_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins

Reply via email to