Comments (8)
Try using:
"service": "toggle"
from dasshio.
I am also having this same issue, and I changed it to Toggle as well.
The exact command works in the developer console, but I am getting the error above when it detects my button press.
{
"name": "Glad",
"address": "MAC",
"domain": "light",
"service": "toggle",
"service_data": "light.office_strip"
from dasshio.
Just to show it's the same:
2018-08-05 15:28:20,000 | INFO | Request: http://hassio/homeassistant/api/services/light/light.toggle
2018-08-05 15:28:20,001 | ERROR | Unable to perform request: Check [url], [body], [headers] and API password or [domain], [service] and [service_data] format.
Traceback (most recent call last):
File "/dasshio.py", line 56, in arp_display
button["service_data"]), headers={'x-ha-access': os.environ.get('HASSIO_TOKEN')})
File "/usr/lib/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
from dasshio.
Ok, now I got it.
Service data should be a json formatted string. Like this:
"service_data": "{\"entity_id\": \"light.room_light\"}"
Please try that and close this issue if that's the solution. Many thanks!
from dasshio.
Hmm, now it is this:
2018-08-05 18:31:33,622 | INFO | Glad button pressed!
2018-08-05 18:31:33,623 | INFO | Request: http://hassio/homeassistant/api/services/light/toggle
2018-08-05 18:31:33,718 | INFO | Status Code: 502
2018-08-05 18:31:33,719 | ERROR | Bad request
{
"timeout": 5,
"buttons": [
{
"name": "Glad",
"address": "MAC",
"domain": "light",
"service": "toggle",
"service_data": "{"xxxxxx09880446f29a832a8xxxxxxxxx": "light.office_strip"}"
}
]
}
from dasshio.
I'm Done with it, Works Just fine now with the following setup
{
"timeout": 20,
"buttons": [
{
"name": "Cafe",
"address": "KC:A6:67:96:7B:6A",
"domain": "switch",
"service": "toggle",
"service_data": "{\"entity_id\": \"switch.office_lights\"}"
}
]
}
from dasshio.
Mine still does not work, even with this:
{
"timeout": 5,
"buttons": [
{
"name": "Glad",
"address": "MAC",
"domain": "light",
"service": "toggle",
"service_data": "{\"entity_id\": \"light.office_strip\"}"
}
]
}
from dasshio.
@mavericksv please check your configuration. @saad1232 reported it just worked.
Make sure you scape the quote symbols in service_data like this: \"
https://github.com/danimtb/dasshio#options-example-domain-service-service_data
from dasshio.
Related Issues (20)
- README.md grammar error
- Errors Log, config HOT 4
- help to understand error in logs HOT 2
- Manual installation HOT 1
- 400 Bad Request from Homeassistant API HOT 1
- Some scripts work - others don't - here's how to fix it HOT 2
- support for 'dash wand'? HOT 1
- How to get dasshio to connect to HA IP address HOT 5
- Where to put the config file ? HOT 2
- Problem with config HOT 7
- Service started but not responding to Dash buttons HOT 5
- README.md regarding Quick Setup
- ERROR (MainThread) [homeassistant.components.hassio.handler] Client error on /addons/03d23610_dasshio/changelog
- Expections since ~ beginning of May
- Dash button stopped working HOT 16
- Amazon Dash button Not working updating Home Assistant 0.102.2 HOT 5
- Format for button connection to wifi HOT 7
- Prevent New Dash Button from Being Bricked HOT 1
- Nmap Device Tracker conflict HOT 1
- Older Dash Buttons HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dasshio.