Giter VIP home page Giter VIP logo

Comments (4)

danimtb avatar danimtb commented on July 3, 2024

Hi @WagnerBeccard, thanks a lot for reporting!

Maybe for your case it is useful to use the URL, BODY and HEADERS interface of dasshio. You can see examples here: https://github.com/danimtb/dasshio#options-url-body-headers

Please try them and let me know! 😄

from dasshio.

Underknowledge avatar Underknowledge commented on July 3, 2024

I try, I try. But therefore my knowledge is to immature..
she setup for a button is straight forward.
"name": "1",

      "address": "AX:6X:BX:EX:DX:8X",
      "domain": "light",
      "service": "toggle",
      "service_data": "{\"entity_id\": \"light.1\"}"

but then with the url.. its over
Not documented well enough.. atm I'm trying to help me with
https://community.home-assistant.io/t/cant-get-amazon-dash-button-working-hassio-dasshio/25031/47
but from top to bottom nothing worked.
btw.. "method": "POST", wont stick in the config - maybe on purpos maybe not.

the most "clean way would be
"name": "Gel",
"address": "mac adress in small letters",
"url": "http://10.0.0.27:8123/api/services/light/toggle",
"headers": "{"login": "pass"}",
"body": "{"entity_id": "light.1"}"


i just see in the log that nothing happens when i press the button. even when i see the button press on the active devices at the router.

starting version 3.2.4
WARNING: No route found for IPv6 destination :: (no default route?). This affects only IPv6
2018-03-02 09:37:46,642 | INFO | Reading config file: /data/options.json
2018-03-02 09:37:46,647 | INFO | Starting sniffing...


Edit.. Ok..
I think it dont work at all.

just did a easy http config - but nothing moves
"url": "http://10.0.0.151/cm?cmnd=Power%20TOGGLE",
"headers": "{}",
"body": "{"payload": "This is an HTTP Post request!"}"

It would be nice if you can see buttonpresses in the logs

I did try to figure out the url body and headers. inconvinient to be honest.

from dasshio.

danimtb avatar danimtb commented on July 3, 2024

@WagnerBeccard I think I dont really get what your problem is.
I have tried url/headers/body configuration in Dasshio and everything worked just fine.

  • Button presses are listed in the logs (even with url/headers/body configuration):
starting version 3.2.4
2018-03-04 18:27:52,926 | INFO | Reading config file: /data/options.json
2018-03-04 18:27:52,930 | INFO | Starting sniffing...
2018-03-04 18:28:01,606 | INFO | Gillette button pressed!
2018-03-04 18:28:01,606 | INFO | Request: http://hassio/homeassistant/api/services/input_boolean/toggle
2018-03-04 18:28:02,119 | INFO | Status Code: 200
2018-03-04 18:28:02,120 | INFO | Successful request
2018-03-04 18:28:02,184 | INFO | Packet captured, waiting 10s ...
2018-03-04 18:28:12,195 | INFO | Starting sniffing...
  • HTTP request is POST always:

    request = requests.post(url_request, json=json.loads(

  • You can setup as many buttons as you like.

  • You can mix url/body/headers configurations with domain/service/service_data ones:

{
  "timeout": 10,
  "buttons": [
    {
      "name": "Gillette",
      "address": "AB:66:BC:98:C4:0D",
      "url": "https://ha_url_here.duckdns.org/api/services/switch/toggle",
      "headers": "{\"x-ha-access\": \"yoursecretpasswordhere\"}",
      "body": "{\"entity_id\":\"input_boolean.dash_gillette\"}"
    },
    {
      "name": "Gillette2",
      "address": "AT:63:BE:86:C7:0F",
      "domain": "input_boolean",
      "service": "toggle",
      "service_data": "{\"entity_id\":\"input_boolean.dash_gillette\"}"
    }
  ]
}

So maybe your problem is that you are not scaping " correctly. You have to use \" in order to use json format in body and headers. See the WARNING at the end of this section: https://github.com/danimtb/dasshio/blob/master/README.md#options-example-domain-service-service_data

Please, follow the examples in the readme and let me know if that works.

from dasshio.

Underknowledge avatar Underknowledge commented on July 3, 2024

well.. I' did try my best - no chance.
Guessed the api wasn't correctly setted up, that the buttons are on a different network, tried it with wireless instead of wired.. but I can't get it to work.
Changing tomorrow to hasbian and see if dasher works. Maybe it's my Network we ll see.
guessed first the buttons don't work because of the wrong network-prefix notation.
That's why I opened this issue, to use the intuitive options like domain, service and service_data
(i figured it out now how to use the url, body, headers part.. but it was a pain)

from dasshio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.