Send data to HA using REST API from Loxone

Hello,

I am writing to ask for your help. I would like to send data to HA from Loxone using REST API. I know there is Loxone integration but for some reason it breaks my Sonos integration.

I have prepared two helpers and created long-time token
Input_button.ring
Input_text.tts

I would like to press the ring button and I am using the following data to do it
Instruction: /api/services/input_button/press
Header: Authorization: ‘Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIyZjdmMTg0MzdlOTc0M2VlYmVkNzU5OGFhZDQ5ZjA0OCIsImlhdCI6MTY3MDkzNTUwMiwiZXhwIjoxOTg2Mjk1NTAyfQ.3rYiZynVsYf2ozo-AiQsGiIsVJnOhxKkK_YzPpWMbec’\nContent-Type: ‘application/json’
Body: { “entity_id”: “input_button.ring” }
Method: POST

For text use:
I would like to press the ring button and I am using the following data to do it
Instruction: /api/services/input_text/set_value
Header: Authorization: ‘Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIyZjdmMTg0MzdlOTc0M2VlYmVkNzU5OGFhZDQ5ZjA0OCIsImlhdCI6MTY3MDkzNTUwMiwiZXhwIjoxOTg2Mjk1NTAyfQ.3rYiZynVsYf2ozo-AiQsGiIsVJnOhxKkK_YzPpWMbec’
Content-Type: ‘application/json’
Body: {“entity_id”: “input_text.tts”,“value”: “{{ }}”}
Method: POST

Unfortunately, neither of the commands works.

Do you think you could help me?

Thank you guys.

Have a look at

For the button, you want to use the POST /api/services/button/press service
For the input test, POST /api/states/input_text.tts

Not sure where you got the values you are using, tbh…

I have checked the rest API and I am sure that the domain for the button is input_button as it is shown like this in my automations. The same applies to input_text. They were created using option to add helpers.

The rest of the values I found in other posts though.

Ok, I have tried different commands and the main issue seems to be the authentification.

Every time the command is carried on I receive:
2022-12-14 10:46:43.635 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 192.168.1.41 (192.168.1.41). Requested URL: ‘/api/services/input_text/set_value’. ([en])
2022-12-14 10:46:46.972 WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 192.168.1.41 (192.168.1.41). Requested URL: ‘/api/services/input_button/press’. ([en])

I use:
Headers when on: `

authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI4Mjg2Y2ExYmM5N2U0YjI2YTM3MjJmYTdhNDZkZGE3ZiIsImlhdCI6MTY3MTAwNjgxMiwiZXhwIjoxOTg2MzY2ODEyfQ.eV7CQ4N0MNAQMjxtC2dPZmxIU-zTEmoDuQpr2npJquQ'\r\ncontent-type: 'application/json'

Any idea why?

hi. i have the same problem. did you find any solution to this?
Thanks

do you have any solution?
Thx :slight_smile: