X100
February 14, 2022, 8:34pm
1
Windows 10 / Virtualbox
In configuration.yaml I put :
api:
I tried to connect with this code, I can connect to https://XXconnect.nl:9000 so there is no firewall problem.
The error is: curl: (7) Failed to connect to XXconnect.in port 9000: Bad access
I tried different 10 years Tokens
Do I need to install something else ?
curl -g -X GET -H “Authorization: Bearer eRyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI1NWIxYzRhNDY3OTA0NmM3ODU2ZmJhYjNmMDA5NTlhMyIsImlhdCI6MTY0NDc3MTM2MywiZXhwIjoxOTYwMTMxMzYzfQ.PBziNcqd9xD0QTSC6Ok-kaEtNvxx4fsf2honW8CbWWE” https://XXconnect.nl:9000/api/states
nickrout
(Nick Rout)
February 15, 2022, 5:39am
2
So xxconnect.nl issues 10 year tokens?
X100
February 15, 2022, 11:59am
3
Sorry, English is not my first language,
I mean I tried to use different Tokens, created in HA.
Thanks for your answere.
nickrout
(Nick Rout)
February 15, 2022, 6:47pm
4
HA tokens are not for accessing other sites/apis on the internet.
X100
February 16, 2022, 1:17am
5
That’s clear…
Can you please tell me what I need to do ?
I want a switch that sends data (on/off) to my Arduino.
Something like a switch that’s connected to a “Home Assistant websocket”.
I don’t want to use ESPHome…
Thank you.
nickrout
(Nick Rout)
February 16, 2022, 3:10am
6
How does the arduino receive data? Does it have a rest api?
X100
February 16, 2022, 9:45pm
7
Great tip, I tried https://github.com/marcoschwartz/aREST on my ESP8266 and it’s working.
Thank you…
shell_command:
switch_1_on: curl -X GET "http://192.168.2.90/digital/5/1"
switch_1_off: curl -X GET "http://192.168.2.90/digital/5/0"
switch 5:
- platform: template
switches:
garagedeur_switch:
friendly_name: ESP8266 Open
value_template: ""
turn_on:
service: shell_command.switch_1_on
turn_off:
service: shell_command.switch_1_off