Repository: Dasher; RTL433 to MQTT Bridge; Ink printer ink reporting

Tags: #<Tag:0x00007f739effaa50>

Hi All,

Thought you might find this useful.
I modified my dasher Docker image to work with hass.io.

I created a repo to host it:

Instructions are here:

You will need SSH access to your hassio host in order to scan for new buttons. See the readme on GitHub. (Alternative is to check router dhcp leases to obtain a buttons MAC address).

Tested with hass.io deployed on x86 ubuntu.
Tested with hass.io on RPi 3 (thanks for confirming @LaurensBot)

10 Likes

Works great on a RPi3!

1 Like

Update: Breaking change: Updated to support hass.io add-ons options to define the dasher config.
Testers welcome!

1 Like

Sadly I had to roll back this change as some testers found an incompatability between Dasher’s nested JSON config and the allowed schema for hass.io addion options.
If/when the hass.io options schema allows for the dasher config schema I will re-enable editing config via add-on options.
NB my choice is not to modify dasher to align with hass.io.

3 Likes

Anyway to get this working with Host os 1.1? According to this link;

Is it because its built locally? It loads correctly, just doesn’t work anymore. It worked perfectly on previous os (1.0)

I’ve been away on business this week, but I’ll try to resolve this issue at the weekend

Thanks, appreciate it

It seems to be an issue with the way that hass.io is reading the repo.
As a short term workaround you can download the ZIP of the repo and copy the dasher dir to your local addons dir (I use samba to do this).
Then install dasher from local addons;

I’m continuing to try and find a solution

1 Like

Please update your docker to latest version and try again…
Its working for me with docker 17.09 (latest)

1 Like

Works great, again. Thanks!

Looks like it installed fine but when I go to run it with json data I get this error:

starting version 3.2.2
cp: can’t stat ‘/config/dasher/config.json’: No such file or directory

Hi @hgelpke
I had to rollback the support for config via the add-on options - see here
You need to create a dasher folder in your config dir and put the config.json there.

Now I’m getting this error when I run it (after local install)

starting version 3.2.2
[email protected] start /root/dasher
node app.js
/root/dasher/app.js:6
for (var i = 0; i < config.buttons.length; i++) {
^
TypeError: Cannot read property ‘length’ of undefined
at Object. (/root/dasher/app.js:6:35)
at Module._compile (module.js:570:32)
at Object.Module._extensions…js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:390:7)
at startup (bootstrap_node.js:150:9)
at bootstrap_node.js:505:3
npm ERR! Linux 4.4.50
npm ERR! argv “/usr/bin/node” “/usr/bin/npm” “run” “start”
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] start: node app.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script ‘node app.js’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the dasher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node app.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs dasher
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR! npm owner ls dasher
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /root/dasher/npm-debug.log

Can you post your config.json please?

{
“name”: “Dasher”,
“version”: “0.2”,
“slug”: “dasher”,
“description”: “Amazon Dash button support”,
“startup”: “before”,
“boot”: “auto”,
“url”: “https://github.com/james-fry/hassio-addons/tree/master/dasher”,
“map”: [“config:rw”, “ssl”],
“host_network”: “True”,
“options”: {},
“schema”: {}
},
{
“name”: “Dash 2”,
“address”: “xx:xx:xx:xx”,
“interface”: “ens33”,
“protocol”: “udp”,
“url”: “https://URL/api/services/light/toggle”,
“method”: “POST”,
“headers”: {“authorization”: “PASSWORD”},
“json”: true,
“body”: {“entity_id”: “light.hall”}
}

Looks like your problem is that you merged the two config.json files (yes I know - its not ideal that they’re both called the same, but this is due to hass.io and dasher :))

If you’re installing from hassio local addons dir, this should be your config.json that controls the deployment of the dasher addon:

{
  "name": "Dasher",
  "version": "0.2",
  "slug": "dasher",
  "description": "Amazon Dash button support",
  "startup": "before",
  "boot": "auto",
  "url": "https://github.com/james-fry/hassio-addons/tree/master/dasher",
  "map": ["config:rw", "ssl"],
  "host_network": "True",
  "options": {},
  "schema": {}
}

If you install the addon from my repo then you dont need to put this anywhere…

The dasher addon (whether installed from local addons dir, or from my GH repo) expects to find the dasher button config.json in your HA config dir in a subdir called dasher.

i.e if using samba addon this would be the URN:

\\hassio.local\config\dasher\config.json

You config.json for button config looks like this:

{
“name”: “Dash 2”,
“address”: “xx:xx:xx:xx”,
“interface”: “ens33”,
“protocol”: “udp”,
“url”: “https://URL/api/services/light/toggle”,
“method”: “POST”,
“headers”: {“authorization”: “PASSWORD”},
“json”: true,
“body”: {“entity_id”: “light.hall”}
}

I notice that the example you posted has “” that are not standard - you can see above that the json syntax highlighting is not working.

It should be:

{
"name": "Dash 2",
"address": "xx:xx:xx:xx:XX:XX",
"interface": "ens33",
"protocol": "udp",
"url": "https://URL/api/services/light/toggle",
"method": "POST",
"headers": {"authorization": "PASSWORD"},
"json": true,
"body": {"entity_id": "light.hall"}
}

Using just the json data you posted above, modified with my info, and a completely fresh local install, I still get the same error.

Just so I’m not missing something, I am manually creating and editing a config.json file in my config/dasher folder and populating the data there. I’m not putting it in the config options on the app screen as that didn’t seem to work.

You had also made mention above about updating docker but I don’t see the option in Hass.io to do that unless I’m completely missing it.

I just tried your config and saw you didnt have the “buttons” definition encapsulating.
Try with this:

{"buttons":[
  {
"name": "Dash 2",
"address": "xx:xx:xx:xx:XX:XX",
"interface": "ens33",
"protocol": "udp",
"url": "https://URL/api/services/light/toggle",
"method": "POST",
"headers": {"authorization": "PASSWORD"},
"json": true,
"body": {"entity_id": "light.hall"}
}
]}

With this, my log is:

starting version 3.2.2

> [email protected] start /root/dasher
> node app.js

[2017-10-13T22:31:37.349Z] Dash 2 added.

That did the trick!

Thanks for all your help. I really appreciate it.

1 Like