Trying to remember how I got Philips Hue Lights controlled on the Mycodo/R-Pi server. - TroubleShooting/Documenting

image

Well I found my old Philips hue board that I had soldered my Header pins onto in order to root this thing.
image

Wasn’t sure if it had a static or dynamic Ip but I just used Zen-map scan of my network to find it’s IP. I didn’t want to break out my UART for serial communication so this was faster in my mind.

I first ran a scan with the [Philips-Hue device] (running/on my WIFI network) and took a screenshot of all my devices.

Then I unplugged the [Philips-Hue device] and rescanned my network taking another screen shot and doing a visual diff on the images. forgot to run a faster scan so this took unnecessarily long time…

And I compared the two lists and I’m guessing even though I didn’t hit save and I closed out zenmap that it was cashed so as a backup I just logged into my router and found my IP-Address of the [Philips-Hue device].

I navigated to this device… I think this is my other Hue Controller thought that has not been rooted.
image

I unplugged that device and observed the results.

The webpage had been cashed so it persisted even after a refresh but closing the webpage and attempting to access it again produced.
image

So the search for my rooted Philips Hue continued…

Seriously contemplating breaking out the UART and just talking to it serial but I believe I’ll find it via my router…

Not certain that WIFI is running on this device anymore I plug in the ethernet cable and look in my router again.

Success! I’ve found the elusive [Philips-Hue device]
image

They appear to be identical screens if you navigate to their ip-addy’s but the logo on this device is broken I noticed… maybe coincidence there. Anyway, that leas me to believe I have to SSH onto this so I will use Putty on this one.
Tried Putty for just SSH setting that should work and no-joy. Figured I’m grasping at straws so I set Zenmap to do a full scan on just this device and see what ports it has open. Listed a bit of ports among which were 80 and 8080.
So pretty much knew I needed to just specify port on my URL with either appending :80 or :8080.

:80
image

:8080
image

Tricksy Rabbitz….
image

image

So at this point I’m starting to wonder if I shouldn’t have broken out the UART from the start… But I guess this is good info for collecting purposes.

I’ll try putty specifying port prior attempts via web-browser failed.
image

Shoot… forgot about 443… lets try it…
image

Okay so 443 is hosting the web page… I guess good to know. That explains that… I guess 80 and 8080 are Illusive but at this point I think the admin client Is only going to be accessed via Serial connection so I put off breaking out the UART long enough.

https://github.com/bahamas10/hueadm - just a side note lots of good information on controlling the P-Hue in this article.

Reading through this link I didn’t believe it was the resource I used to determine which Pins needed Vcc, Gnd, TX and RX. So, the search continues…

https://forum.archive.openwrt.org/viewtopic.php?id=66346 - Reading through this produced the following bit of information:

1. UART
UART is located in J1 and J6 (standard 2,54 mm pitch header), J6 pinout:
1 - GND
4 - RX
5 - TX

From <https://forum.archive.openwrt.org/viewtopic.php?id=66346> 

I was hoping for a picture of the board because the PCB has small lettering and I wanted to be certain where I was attaching my cables to. So, I continued to look for a picture of the Pins labeled out on the board.

I’m fairly certain I had enabled Wifi on one of these devices but if memory served only certain models are capable or maybe my guides only worked with certain models. One or the other.

image

I created a schematic that was bad here that I’m leaving out as I didn’t use it for this and it would be misleading.

So, I’ve seen it in 2 places now. 1=GND, 4=RX, 5=TX. Looks like no VCC. Which is convenient because I only had (3)-wires handy without digging.

https://blog.andreibanaru.ro/2018/03/27/philips-hue-2-1-enabling-wifi/ MIght Need Later

When I inspect the board I’m working on and compare it to the above screenshot I notice my header pins are not as expected…

image

I’m not certain if that was a experiment but I don’t believe I should use the header pins that are soldered on. My solution is the following though.
image

So,
RX-PURPLE/ORANGE Later becomes Yellow
TX-BLUE
GND-GREEN
image

On the UART we’ve got the following:
RX-PURPLE/YELLOW
TX-BLUE
GND-GREEN
image

I’m saying:
1-Green is ground. Easy
4-UART says its RX and on the Phue Board its expecting RX
5 - UART says its TX and on the Phue Board is expecting TX

I’m ready to plug it all up and see if I can talk to it.
image

So says, my UART is listed as COM6 in Device manager.

Fire up Putty here and take a look I suppose…
image

We’ll give defaults a try but highly unlikely…
image

No-joy but was expecting that. I’m just loose’y goosey with those pins so this might be right and I’ve got bad connections at the board. I’m going to check this setting to be certain what the speed should be set to.
Hooked things up got some junk when I hit the keyboard unplugged everything.

Powered on the PHUE device and the UART
image

Pressing the keyboard produces the above which is good I’m close either my TX/RX are reversed or my Baud Rate is wrong.
Gonna swap Pins
Power down everything…
Swap RX and TX
Power up.

Well now I don’t get anything going to put them back
Power down everything…
Swap RX and TX
Power up.

Thinking there’s a setting in addition to Baud going to check.

Or I should use a different UART… Lets try different UART. Cant’ find anything obvious other than Baud right now.

Turns out I fried that UART… So I’ve got a couple others that I’m less confident in…

I inspected the board but it didn’t label the header pins so I couldn’t remember the details on what went into getting this all to work but thankfully I recalled reaching out to Kyle a while back and found the following:
https://github.com/kizniche/Mycodo/issues/722

Is your feature request related to a problem? Please describe.**
Light automation support/Ideas with Philips Hue

Describe the solution you’d like
I would like to use mycodo for light schedules with the philips hue lights. Also, could it send an alert - set a light bulb a notification color. Example: temp high alarm - light turns red
I’m pretty excited about this one…
I found this URL https://github.com/bahamas10/hueadm
So I ran:

	curl -sL  https://deb.nodesource.com/setup_13.x | sudo -E bash -

image
image

	sudo apt-get install -y nodejs

image

	smguth@mycodo:~ $ sudo apt-get install -y nodejs
	Reading package lists... Done
	Building dependency tree... Done
	Reading state information... Done
	The following package was automatically installed and is no longer required:
	  libfuse2
	Use 'sudo apt autoremove' to remove it.
	The following additional packages will be installed:
	  libc-ares2 libjs-highlight.js libnode72 nodejs-doc
	Suggested packages:
	  npm
	The following NEW packages will be installed:
	  libc-ares2 libjs-highlight.js libnode72 nodejs nodejs-doc
	0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
	Need to get 10.4 MB of archives.
	After this operation, 45.6 MB of additional disk space will be used.
	Get:1 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libc-ares2 armhf 1.17.1-1+deb11u2 [96.2 kB]
	Get:2 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libjs-highlight.js all 9.18.5+dfsg1-1 [397 kB]
	Get:3 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf libnode72 armhf 12.22.12~dfsg-1~deb11u4 [7,261 kB]
	Get:4 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf nodejs armhf 12.22.12~dfsg-1~deb11u4 [148 kB]
	Get:5 http://raspbian.raspberrypi.org/raspbian bullseye/main armhf nodejs-doc all 12.22.12~dfsg-1~deb11u4 [2,547 kB]
	Fetched 10.4 MB in 3s (3,750 kB/s)
	Selecting previously unselected package libc-ares2:armhf.
	(Reading database ... 107381 files and directories currently installed.)
	Preparing to unpack .../libc-ares2_1.17.1-1+deb11u2_armhf.deb ...
	Unpacking libc-ares2:armhf (1.17.1-1+deb11u2) ...
	Selecting previously unselected package libjs-highlight.js.
	Preparing to unpack .../libjs-highlight.js_9.18.5+dfsg1-1_all.deb ...
	Unpacking libjs-highlight.js (9.18.5+dfsg1-1) ...
	Selecting previously unselected package libnode72:armhf.
	Preparing to unpack .../libnode72_12.22.12~dfsg-1~deb11u4_armhf.deb ...
	Unpacking libnode72:armhf (12.22.12~dfsg-1~deb11u4) ...
	Selecting previously unselected package nodejs.
	Preparing to unpack .../nodejs_12.22.12~dfsg-1~deb11u4_armhf.deb ...
	Unpacking nodejs (12.22.12~dfsg-1~deb11u4) ...
	Selecting previously unselected package nodejs-doc.
	Preparing to unpack .../nodejs-doc_12.22.12~dfsg-1~deb11u4_all.deb ...
	Unpacking nodejs-doc (12.22.12~dfsg-1~deb11u4) ...
	Setting up libc-ares2:armhf (1.17.1-1+deb11u2) ...
	Setting up libnode72:armhf (12.22.12~dfsg-1~deb11u4) ...
	Setting up libjs-highlight.js (9.18.5+dfsg1-1) ...
	Setting up nodejs (12.22.12~dfsg-1~deb11u4) ...
	update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode
	Setting up nodejs-doc (12.22.12~dfsg-1~deb11u4) ...
	Processing triggers for man-db (2.9.4-2) ...
	Processing triggers for libc-bin (2.31-13+rpt2+rpi1+deb11u5) ...

sudo npm install -g hueadm
image

sudo npm install -g hueadm
image

	added 41 packages, and audited 243 packages in 20s
	
	4 packages are looking for funding
	  run `npm fund` for details
	
	32 vulnerabilities (1 low, 13 moderate, 11 high, 7 critical)
	
	To address issues that do not require attention, run:
	  npm audit fix
	
	Some issues need review, and may require choosing
	a different dependency.
	
	Run `npm audit` for details.

sudo apt-get install npm
image

sudo npm install -g hueadm
	Press 'Y'
	Press 'Enter'
	4
	Preparing to unpack .../047-node-tweetnacl_1.0.3+dfsg-1_all.deb ...
	Unpacking node-tweetnacl (1.0.3+dfsg-1) ...
	Selecting previously unselected package node-bcrypt-pbkdf.
	Preparing to unpack .../048-node-bcrypt-pbkdf_1.0.2-1_all.deb ...
	Unpacking node-bcrypt-pbkdf (1.0.2-1) ...
	Selecting previously unselected package node-brace-expansion.
	Preparing to unpack .../049-node-brace-expansion_2.0.0-1_all.deb ...
	Unpacking node-brace-expansion (2.0.0-1) ...
	Selecting previously unselected package node-builtins.
	Preparing to unpack .../050-node-builtins_1.0.3-2_all.deb ...
	Unpacking node-builtins (1.0.3-2) ...
	Selecting previously unselected package node-chownr.
	Preparing to unpack .../051-node-chownr_1.1.3-5_all.deb ...
	Unpacking node-chownr (1.1.3-5) ...
	Selecting previously unselected package node-fs.realpath.
	Preparing to unpack .../052-node-fs.realpath_1.0.0-1.1_all.deb ...
	Unpacking node-fs.realpath (1.0.0-1.1) ...
	Selecting previously unselected package node-wrappy.
	Unpacking node-columnify (1.5.4-3) ...
	Selecting previously unselected package node-delayed-stream.
	Preparing to unpack .../085-node-delayed-stream_1.0.0-4_all.deb ...
	Unpacking node-delayed-stream (1.0.0-4) ...
	Selecting previously unselected package node-combined-stream.
	Preparing to unpack .../086-node-combined-stream_1.0.8-1_all.deb ...
	Unpacking node-combined-stream (1.0.8-1) ...
	Selecting previously unselected package node-concat-map.
	Preparing to unpack .../087-node-concat-map_0.0.1-2_all.deb ...
	Unpacking node-concat-map (0.0.1-2) ...
	Selecting previously unselected package node-console-control-strings.
	Preparing to unpack .../088-node-console-control-strings_1.1.0-2_all.deb ...
	Unpacking node-console-control-strings (1.1.0-2) ...
	Selecting previously unselected package node-dashdash.
	Preparing to unpack .../089-node-dashdash_2.0.0-1_all.deb ...
	Unpacking node-dashdash (2.0.0-1) ...
	Selecting previously unselected package node-depd.
	Preparing to unpack .../090-node-depd_2.0.0-1_all.deb ...
	Unpacking node-depd (2.0.0-1) ...
	Selecting previously unselected package node-jsbn.
	Preparing to unpack .../091-node-jsbn_1.1.0-1.1_all.deb ...
	Unpacking node-jsbn (1.1.0-1.1) ...
	Selecting previously unselected package node-ecc-jsbn.
	Preparing to unpack .../092-node-ecc-jsbn_0.2.0-2_all.deb ...
	Unpacking node-ecc-jsbn (0.2.0-2) ...
	Selecting previously unselected package node-iconv-lite.
	Preparing to unpack .../093-node-iconv-lite_0.5.1-3_all.deb ...
	Unpacking node-iconv-lite (0.5.1-3) ...
	Selecting previously unselected package node-encoding.
	Preparing to unpack .../094-node-encoding_0.1.13-1_all.deb ...
	Unpacking node-encoding (0.1.13-1) ...
	Selecting previously unselected package node-err-code.
	Preparing to unpack .../095-node-err-code_2.0.3+dfsg-1_all.deb ...
	Unpacking node-err-code (2.0.3+dfsg-1) ...
	Selecting previously unselected package node-extend.
	Preparing to unpack .../096-node-extend_3.0.2-1_all.deb ...
	Unpacking node-extend (3.0.2-1) ...
	Selecting previously unselected package node-extsprintf.
	Preparing to unpack .../097-node-extsprintf_1.4.0-1_all.deb ...
	Unpacking node-extsprintf (1.4.0-1) ...
	Selecting previously unselected package node-forever-agent.
	Preparing to unpack .../098-node-forever-agent_0.6.1-2_all.deb ...
	Unpacking node-forever-agent (0.6.1-2) ...
	Selecting previously unselected package node-mime.
	Preparing to unpack .../099-node-mime_2.5.0+dfsg+~cs3.90.0-1_all.deb ...
	Unpacking node-mime (2.5.0+dfsg+~cs3.90.0-1) ...
	Selecting previously unselected package node-mime-types.
	Preparing to unpack .../100-node-mime-types_2.1.28-1_all.deb ...
	Unpacking node-mime-types (2.1.28-1) ...
	Selecting previously unselected package node-form-data.
	Preparing to unpack .../101-node-form-data_3.0.0-2_all.deb ...
	Unpacking node-form-data (3.0.0-2) ...
	Selecting previously unselected package node-function-bind.
	Preparing to unpack .../102-node-function-bind_1.1.1+repack-1_all.deb ...
	Unpacking node-function-bind (1.1.1+repack-1) ...
	Selecting previously unselected package node-string-width.
	Preparing to unpack .../103-node-string-width_4.2.0-1_all.deb ...
	Unpacking node-string-width (4.2.0-1) ...
	Selecting previously unselected package node-object-assign.
	Preparing to unpack .../104-node-object-assign_4.1.1-3_all.deb ...
	Unpacking node-object-assign (4.1.1-3) ...
	Selecting previously unselected package node-has-unicode.
	Preparing to unpack .../105-node-has-unicode_2.0.1-2_all.deb ...
	Unpacking node-has-unicode (2.0.1-2) ...
	Selecting previously unselected package node-wide-align.
	Preparing to unpack .../106-node-wide-align_1.1.3-1_all.deb ...
	Unpacking node-wide-align (1.1.3-1) ...
	Selecting previously unselected package node-signal-exit.
	Preparing to unpack .../107-node-signal-exit_3.0.3-1_all.deb ...
	Unpacking node-signal-exit (3.0.3-1) ...
	Selecting previously unselected package node-gauge.
	Preparing to unpack .../108-node-gauge_2.7.4-1.1_all.deb ...
	Unpacking node-gauge (2.7.4-1.1) ...
	Selecting previously unselected package node-getpass.
	Preparing to unpack .../109-node-getpass_0.1.7-1.1_all.deb ...
	Unpacking node-getpass (0.1.7-1.1) ...
	Selecting previously unselected package node-nopt.
	Preparing to unpack .../110-node-nopt_5.0.0-1_all.deb ...
	Unpacking node-nopt (5.0.0-1) ...
	Selecting previously unselected package node-set-blocking.
	Preparing to unpack .../111-node-set-blocking_2.0.0-1.1_all.deb ...
	Unpacking node-set-blocking (2.0.0-1.1) ...
	Selecting previously unselected package node-npmlog.
	Preparing to unpack .../112-node-npmlog_4.1.2-2_all.deb ...
	Unpacking node-npmlog (4.1.2-2) ...
	Selecting previously unselected package node-osenv.
	Preparing to unpack .../113-node-osenv_0.1.5-1_all.deb ...
	Unpacking node-osenv (0.1.5-1) ...
	Selecting previously unselected package node-tar.
	Preparing to unpack .../114-node-tar_6.0.5+ds1+~cs11.3.9-1+deb11u2_all.deb ...
	Unpacking node-tar (6.0.5+ds1+~cs11.3.9-1+deb11u2) ...
	Selecting previously unselected package node-isexe.
	Preparing to unpack .../115-node-isexe_2.0.0-5_all.deb ...
	Unpacking node-isexe (2.0.0-5) ...
	Selecting previously unselected package node-which.
	Preparing to unpack .../116-node-which_2.0.2+~cs1.3.2-1_all.deb ...
	Unpacking node-which (2.0.2+~cs1.3.2-1) ...
	Selecting previously unselected package node-gyp.
	Preparing to unpack .../117-node-gyp_7.1.2-4_all.deb ...
	Unpacking node-gyp (7.1.2-4) ...
	Selecting previously unselected package node-har-schema.
	Preparing to unpack .../118-node-har-schema_2.0.0-4_all.deb ...
	Unpacking node-har-schema (2.0.0-4) ...
	Selecting previously unselected package node-har-validator.
	Preparing to unpack .../119-node-har-validator_5.1.5-1_all.deb ...
	Unpacking node-har-validator (5.1.5-1) ...
	Selecting previously unselected package node-hosted-git-info.
	Preparing to unpack .../120-node-hosted-git-info_3.0.8-1_all.deb ...
	Unpacking node-hosted-git-info (3.0.8-1) ...
	Selecting previously unselected package node-json-schema.
	Preparing to unpack .../121-node-json-schema_0.3.0+~7.0.6-1+deb11u1_all.deb ...
	Unpacking node-json-schema (0.3.0+~7.0.6-1+deb11u1) ...
	Selecting previously unselected package node-verror.
	Preparing to unpack .../122-node-verror_1.10.0-1.1_all.deb ...
	Unpacking node-verror (1.10.0-1.1) ...
	Selecting previously unselected package node-jsprim.
	Preparing to unpack .../123-node-jsprim_2.0.0-1_all.deb ...
	Unpacking node-jsprim (2.0.0-1) ...
	Selecting previously unselected package node-sshpk.
	Preparing to unpack .../124-node-sshpk_1.16.1+dfsg-2_all.deb ...
	Unpacking node-sshpk (1.16.1+dfsg-2) ...
	Selecting previously unselected package node-http-signature.
	Preparing to unpack .../125-node-http-signature_1.3.5-1_all.deb ...
	Unpacking node-http-signature (1.3.5-1) ...
	Selecting previously unselected package node-https-proxy-agent.
	Preparing to unpack .../126-node-https-proxy-agent_5.0.0-3_all.deb ...
	Unpacking node-https-proxy-agent (5.0.0-3) ...
	Selecting previously unselected package node-ini.
	Preparing to unpack .../127-node-ini_2.0.0-1_all.deb ...
	Unpacking node-ini (2.0.0-1) ...
	Selecting previously unselected package node-ip.
	Preparing to unpack .../128-node-ip_1.1.5-5_all.deb ...
	Unpacking node-ip (1.1.5-5) ...
	Selecting previously unselected package node-ip-regex.
	Preparing to unpack .../129-node-ip-regex_4.3.0-1_all.deb ...
	Unpacking node-ip-regex (4.3.0-1) ...
	Selecting previously unselected package node-is-typedarray.
	Preparing to unpack .../130-node-is-typedarray_1.0.0-3_all.deb ...
	Unpacking node-is-typedarray (1.0.0-3) ...
	Selecting previously unselected package node-isstream.
	Preparing to unpack .../131-node-isstream_0.1.2+dfsg-1.1_all.deb ...
	Unpacking node-isstream (0.1.2+dfsg-1.1) ...
	Selecting previously unselected package node-json-parse-better-errors.
	Preparing to unpack .../132-node-json-parse-better-errors_1.0.2+~2.3.1-1_all.deb ...
	Unpacking node-json-parse-better-errors (1.0.2+~2.3.1-1) ...
	Selecting previously unselected package node-json-stringify-safe.
	Preparing to unpack .../133-node-json-stringify-safe_5.0.1+repack-3_all.deb ...
	Unpacking node-json-stringify-safe (5.0.1+repack-3) ...
	Selecting previously unselected package node-jsonparse.
	Preparing to unpack .../134-node-jsonparse_1.3.1-7_all.deb ...
	Unpacking node-jsonparse (1.3.1-7) ...
	Selecting previously unselected package node-through.
	Preparing to unpack .../135-node-through_2.3.8+~cs0.0.30-1_all.deb ...
	Unpacking node-through (2.3.8+~cs0.0.30-1) ...
	Selecting previously unselected package node-jsonstream.
	Preparing to unpack .../136-node-jsonstream_1.3.5-1_all.deb ...
	Unpacking node-jsonstream (1.3.5-1) ...
	Selecting previously unselected package node-leven.
	Preparing to unpack .../137-node-leven_3.1.0+~cs1.1.1-1_all.deb ...
	Unpacking node-leven (3.1.0+~cs1.1.1-1) ...
	Selecting previously unselected package node-lockfile.
	Preparing to unpack .../138-node-lockfile_1.0.4-3_all.deb ...
	Unpacking node-lockfile (1.0.4-3) ...
	Selecting previously unselected package node-mute-stream.
	Preparing to unpack .../139-node-mute-stream_0.0.8-2_all.deb ...
	Unpacking node-mute-stream (0.0.8-2) ...
	Selecting previously unselected package node-resolve.
	Preparing to unpack .../140-node-resolve_1.19.0+~cs5.20.8-2_all.deb ...
	Unpacking node-resolve (1.19.0+~cs5.20.8-2) ...
	Selecting previously unselected package node-spdx-license-ids.
	Preparing to unpack .../141-node-spdx-license-ids_3.0.7-1_all.deb ...
	Unpacking node-spdx-license-ids (3.0.7-1) ...
	Selecting previously unselected package node-spdx-exceptions.
	Preparing to unpack .../142-node-spdx-exceptions_2.3.0-1_all.deb ...
	Unpacking node-spdx-exceptions (2.3.0-1) ...
	Selecting previously unselected package node-spdx-expression-parse.
	Preparing to unpack .../143-node-spdx-expression-parse_3.0.1-1_all.deb ...
	Unpacking node-spdx-expression-parse (3.0.1-1) ...
	Selecting previously unselected package node-spdx-correct.
	Preparing to unpack .../144-node-spdx-correct_3.1.1-1_all.deb ...
	Unpacking node-spdx-correct (3.1.1-1) ...
	Selecting previously unselected package node-validate-npm-package-license.
	Preparing to unpack .../145-node-validate-npm-package-license_3.0.4-1_all.deb ...
	Unpacking node-validate-npm-package-license (3.0.4-1) ...
	Selecting previously unselected package node-normalize-package-data.
	Preparing to unpack .../146-node-normalize-package-data_3.0.0+~2.4.0-1_all.deb ...
	Unpacking node-normalize-package-data (3.0.0+~2.4.0-1) ...
	Selecting previously unselected package node-npm-bundled.
	Preparing to unpack .../147-node-npm-bundled_1.1.1-1_all.deb ...
	Unpacking node-npm-bundled (1.1.1-1) ...
	Selecting previously unselected package node-validate-npm-package-name.
	Preparing to unpack .../148-node-validate-npm-package-name_3.0.0-1.1_all.deb ...
	Unpacking node-validate-npm-package-name (3.0.0-1.1) ...
	Selecting previously unselected package node-npm-package-arg.
	Preparing to unpack .../149-node-npm-package-arg_8.1.0-1_all.deb ...
	Unpacking node-npm-package-arg (8.1.0-1) ...
	Selecting previously unselected package node-number-is-nan.
	Preparing to unpack .../150-node-number-is-nan_2.0.0-1_all.deb ...
	Unpacking node-number-is-nan (2.0.0-1) ...
	Selecting previously unselected package node-oauth-sign.
	Preparing to unpack .../151-node-oauth-sign_0.9.0-2_all.deb ...
	Unpacking node-oauth-sign (0.9.0-2) ...
	Selecting previously unselected package node-opener.
	Preparing to unpack .../152-node-opener_1.5.2-1_all.deb ...
	Unpacking node-opener (1.5.2-1) ...
	Selecting previously unselected package node-performance-now.
	Preparing to unpack .../153-node-performance-now_2.1.0+debian-1.1_all.deb ...
	Unpacking node-performance-now (2.1.0+debian-1.1) ...
	Selecting previously unselected package node-retry.
	Preparing to unpack .../154-node-retry_0.12.0-1_all.deb ...
	Unpacking node-retry (0.12.0-1) ...
	Selecting previously unselected package node-promise-retry.
	Preparing to unpack .../155-node-promise-retry_2.0.1-1_all.deb ...
	Unpacking node-promise-retry (2.0.1-1) ...
	Selecting previously unselected package node-read.
	Preparing to unpack .../156-node-read_1.0.7-2_all.deb ...
	Unpacking node-read (1.0.7-2) ...
	Selecting previously unselected package node-promzard.
	Preparing to unpack .../157-node-promzard_0.3.0-1.1_all.deb ...
	Unpacking node-promzard (0.3.0-1.1) ...
	Selecting previously unselected package node-psl.
	Preparing to unpack .../158-node-psl_1.8.0+ds-4_all.deb ...
	Unpacking node-psl (1.8.0+ds-4) ...
	Selecting previously unselected package node-puka.
	Preparing to unpack .../159-node-puka_1.0.1+dfsg-2_all.deb ...
	Unpacking node-puka (1.0.1+dfsg-2) ...
	Selecting previously unselected package node-qs.
	Preparing to unpack .../160-node-qs_6.9.4+ds-1+deb11u1_all.deb ...
	Unpacking node-qs (6.9.4+ds-1+deb11u1) ...
	Selecting previously unselected package node-slash.
	Preparing to unpack .../161-node-slash_3.0.0-1_all.deb ...
	Unpacking node-slash (3.0.0-1) ...
	Selecting previously unselected package node-read-package-json.
	Preparing to unpack .../162-node-read-package-json_3.0.0-1_all.deb ...
	Unpacking node-read-package-json (3.0.0-1) ...
	Selecting previously unselected package node-universalify.
	Preparing to unpack .../163-node-universalify_2.0.0-2_all.deb ...
	Unpacking node-universalify (2.0.0-2) ...
	Selecting previously unselected package node-tough-cookie.
	Preparing to unpack .../164-node-tough-cookie_4.0.0-2_all.deb ...
	Unpacking node-tough-cookie (4.0.0-2) ...
	Selecting previously unselected package node-tunnel-agent.
	Preparing to unpack .../165-node-tunnel-agent_0.6.1-2_all.deb ...
	Unpacking node-tunnel-agent (0.6.1-2) ...
	Selecting previously unselected package node-uuid.
	Preparing to unpack .../166-node-uuid_8.3.2+~8.3.0-4_all.deb ...
	Unpacking node-uuid (8.3.2+~8.3.0-4) ...
	Selecting previously unselected package node-request.
	Preparing to unpack .../167-node-request_2.88.1-5_all.deb ...
	Unpacking node-request (2.88.1-5) ...
	Selecting previously unselected package node-resolve-from.
	Preparing to unpack .../168-node-resolve-from_5.0.0+~3.1.0+~3.3.0+~2.0.0-1_all.deb ...
	Unpacking node-resolve-from (5.0.0+~3.1.0+~3.3.0+~2.0.0-1) ...
	Selecting previously unselected package node-text-table.
	Preparing to unpack .../169-node-text-table_0.2.0-2_all.deb ...
	Unpacking node-text-table (0.2.0-2) ...
	Selecting previously unselected package node-typedarray-to-buffer.
	Preparing to unpack .../170-node-typedarray-to-buffer_4.0.0-1_all.deb ...
	Unpacking node-typedarray-to-buffer (4.0.0-1) ...
	Selecting previously unselected package node-write-file-atomic.
	Preparing to unpack .../171-node-write-file-atomic_3.0.3+~3.0.1-1_all.deb ...
	Unpacking node-write-file-atomic (3.0.3+~3.0.1-1) ...
	Selecting previously unselected package npm.
	Preparing to unpack .../172-npm_7.5.2+ds-2_all.deb ...
	Unpacking npm (7.5.2+ds-2) ...
	Setting up node-forever-agent (0.6.1-2) ...
	Setting up node-qs (6.9.4+ds-1+deb11u1) ...
	Setting up node-delayed-stream (1.0.0-4) ...
	Setting up node-isstream (0.1.2+dfsg-1.1) ...
	Setting up node-builtins (1.0.3-2) ...
	Setting up libuv1-dev:armhf (1.40.0-2) ...
	Setting up node-colors (1.4.0-1) ...
	Setting up node-fs.realpath (1.0.0-1.1) ...
	Setting up node-oauth-sign (0.9.0-2) ...
	Setting up node-jsbn (1.1.0-1.1) ...
	Setting up node-object-assign (4.1.1-3) ...
	Setting up node-extsprintf (1.4.0-1) ...
	Setting up node-leven (3.1.0+~cs1.1.1-1) ...
	Setting up node-abbrev (1.1.1-2) ...
	Setting up node-puka (1.0.1+dfsg-2) ...
	Setting up node-yallist (4.0.0-1) ...
	Setting up libjs-inherits (2.0.4-1) ...
	Setting up node-ansi-regex (5.0.1-1~deb11u1) ...
	Setting up node-slash (3.0.0-1) ...
	Setting up node-util-deprecate (1.0.2-1) ...
	Setting up node-retry (0.12.0-1) ...
	Setting up node-concat-map (0.0.1-2) ...
	Setting up node-assert-plus (1.0.0-2) ...
	Setting up node-ansistyles (0.1.3-2) ...
	Setting up node-delegates (1.0.0-2) ...
	Setting up node-depd (2.0.0-1) ...
	Setting up node-isexe (2.0.0-5) ...
	Setting up node-jsonparse (1.3.1-7) ...
	Setting up node-tweetnacl (1.0.3+dfsg-1) ...
	Setting up node-escape-string-regexp (4.0.0-1) ...
	Setting up node-through (2.3.8+~cs0.0.30-1) ...
	Setting up node-aws-sign2 (0.7.1-2) ...
	Setting up node-color-name (1.1.4+~1.1.1-1) ...
	Setting up node-console-control-strings (1.1.0-2) ...
	Setting up node-uuid (8.3.2+~8.3.0-4) ...
	Setting up node-extend (3.0.2-1) ...
	Setting up node-jsonstream (1.3.5-1) ...
	Setting up node-aws4 (1.11.0-1) ...
	Setting up node-indent-string (4.0.0-1) ...
	Setting up node-dashdash (2.0.0-1) ...
	Setting up node-function-bind (1.1.1+repack-1) ...
	Setting up node-clone (2.1.2-2) ...
	Setting up node-p-map (4.0.0-1) ...
	Setting up node-iferr (1.0.2-1) ...
	Setting up node-chownr (1.1.3-5) ...
	Setting up node-has-flag (4.0.0-1) ...
	Setting up node-validate-npm-package-name (3.0.0-1.1) ...
	Setting up libjs-psl (1.8.0+ds-4) ...
	Setting up node-json-schema-traverse (1.0.0-2) ...
	Setting up node-asap (2.0.6-2) ...
	Setting up node-mime (2.5.0+dfsg+~cs3.90.0-1) ...
	Setting up node-inherits (2.0.4-1) ...
	Setting up node-path-is-absolute (2.0.0-1) ...
	Setting up node-universalify (2.0.0-2) ...
	Setting up node-ini (2.0.0-1) ...
	Setting up node-iconv-lite (0.5.1-3) ...
	Setting up node-ecc-jsbn (0.2.0-2) ...
	Setting up node-safe-buffer (5.2.1+~cs2.1.2-1) ...
	Setting up node-promise-inflight (1.0.1-1.1) ...
	Setting up node-combined-stream (1.0.8-1) ...
	Setting up node-json-stringify-safe (5.0.1+repack-3) ...
	Setting up node-json-parse-better-errors (1.0.2+~2.3.1-1) ...
	Setting up node-fast-deep-equal (3.1.3-1) ...
	Setting up node-har-schema (2.0.0-4) ...
	Setting up node-mime-types (2.1.28-1) ...
	Setting up node-performance-now (2.1.0+debian-1.1) ...
	Setting up node-err-code (2.0.3+dfsg-1) ...
	Setting up node-resolve-from (5.0.0+~3.1.0+~3.3.0+~2.0.0-1) ...
	Setting up node-balanced-match (1.0.0-1) ...
	Setting up node-ansi (0.3.1-1) ...
	Setting up node-brace-expansion (2.0.0-1) ...
	Setting up node-spdx-exceptions (2.3.0-1) ...
	Setting up node-strip-ansi (6.0.0-2) ...
	Setting up node-set-blocking (2.0.0-1.1) ...
	Setting up libssl-dev:armhf (1.1.1n-0+deb11u4+rpt1) ...
	Setting up node-tunnel-agent (0.6.1-2) ...
	Setting up node-npm-bundled (1.1.1-1) ...
	Setting up node-signal-exit (3.0.3-1) ...
	Setting up node-which (2.0.2+~cs1.3.2-1) ...
	Setting up node-wrappy (1.0.2-1.1) ...
	Setting up node-text-table (0.2.0-2) ...
	Setting up node-asynckit (0.4.0-3) ...
	Setting up node-ip (1.1.5-5) ...
	Setting up node-punycode (2.1.1-3) ...
	Setting up node-defaults (1.0.3-2) ...
	Setting up node-mute-stream (0.0.8-2) ...
	Setting up libjs-typedarray-to-buffer (4.0.0-1) ...
	Setting up node-number-is-nan (2.0.0-1) ...
	Setting up node-graceful-fs (4.2.4+repack-1) ...
	Setting up node-jsonify (0.0.0-1.1) ...
	Setting up node-json-stable-stringify (1.0.1+~cs5.1.32-1) ...
	Setting up node-aproba (2.0.0-1) ...
	Setting up node-ip-regex (4.3.0-1) ...
	Setting up node-spdx-license-ids (3.0.7-1) ...
	Setting up node-string-decoder (1.3.0-2) ...
	Setting up node-mkdirp (1.0.4+~1.0.1-1) ...
	Setting up node-run-queue (2.0.0-1) ...
	Setting up node-core-util-is (1.0.2-2) ...
	Setting up node-json-schema (0.3.0+~7.0.6-1+deb11u1) ...
	Setting up node-uri-js (4.4.0+dfsg-5) ...
	Setting up node-minimatch (3.0.4+~3.0.3-1+deb11u2) ...
	Setting up node-opener (1.5.2-1) ...
	Setting up node-archy (1.0.0-3) ...
	Setting up node-caseless (0.12.1-1) ...
	Setting up node-imurmurhash (0.1.4-1.1) ...
	Setting up node-verror (1.10.0-1.1) ...
	Setting up node-getpass (0.1.7-1.1) ...
	Setting up node-encoding (0.1.13-1) ...
	Setting up node-read (1.0.7-2) ...
	Setting up node-nopt (5.0.0-1) ...
	Setting up node-asn1 (0.2.3-2) ...
	Setting up node-color-convert (1.9.3-1) ...
	Setting up node-isarray (2.0.5-1) ...
	Setting up node-osenv (0.1.5-1) ...
	Setting up node-ms (2.1.3+~cs0.7.31-1) ...
	Setting up libjs-is-typedarray (1.0.0-3) ...
	Setting up node-process-nextick-args (2.0.0-1) ...
	Setting up node-has-unicode (2.0.1-2) ...
	Setting up node-fs-write-stream-atomic (1.0.10-4) ...
	Setting up gyp (0.1+20200513gitcaa6002-2) ...
	Setting up node-readable-stream (3.6.0-2) ...
	Setting up node-ssri (8.0.1-2) ...
	Setting up node-lru-cache (5.1.1-5) ...
	Setting up node-bcrypt-pbkdf (1.0.2-1) ...
	Setting up node-promise-retry (2.0.1-1) ...
	Setting up node-supports-color (8.1.0+~7.2.0-1) ...
	Setting up node-once (1.4.0-3) ...
	Setting up node-psl (1.8.0+ds-4) ...
	Setting up libnode-dev (12.22.12~dfsg-1~deb11u4) ...
	Setting up node-jsprim (2.0.0-1) ...
	Setting up node-resolve (1.19.0+~cs5.20.8-2) ...
	Setting up node-ajv (6.12.6-2) ...
	Setting up node-are-we-there-yet (1.1.5-1) ...
	Setting up node-debug (4.3.1+~cs4.1.5-1) ...
	Setting up node-promzard (0.3.0-1.1) ...
	Setting up node-wcwidth.js (1.0.0-1.1) ...
	Setting up node-unique-filename (1.1.1+ds-1) ...
	Setting up node-ansi-styles (4.2.1-1) ...
	Setting up node-form-data (3.0.0-2) ...
	Setting up node-lockfile (1.0.4-3) ...
	Setting up node-chalk (4.1.0-1) ...
	Setting up node-spdx-expression-parse (3.0.1-1) ...
	Setting up node-is-typedarray (1.0.0-3) ...
	Setting up node-tar (6.0.5+ds1+~cs11.3.9-1+deb11u2) ...
	Setting up node-inflight (1.0.6-1.1) ...
	Setting up node-hosted-git-info (3.0.8-1) ...
	Setting up node-tough-cookie (4.0.0-2) ...
	Setting up node-string-width (4.2.0-1) ...
	Setting up node-sshpk (1.16.1+dfsg-2) ...
	Setting up node-semver (7.3.4-1) ...
	Setting up node-har-validator (5.1.5-1) ...
	Setting up node-columnify (1.5.4-3) ...
	Setting up node-agent-base (6.0.2-2) ...
	Setting up node-http-signature (1.3.5-1) ...
	Setting up node-spdx-correct (3.1.1-1) ...
	Setting up node-glob (7.1.6+~7.1.3-1) ...
	Setting up node-typedarray-to-buffer (4.0.0-1) ...
	Setting up node-wide-align (1.1.3-1) ...
	Setting up node-npm-package-arg (8.1.0-1) ...
	Setting up node-request (2.88.1-5) ...
	Setting up node-https-proxy-agent (5.0.0-3) ...
	Setting up node-rimraf (3.0.2-1) ...
	Setting up node-validate-npm-package-license (3.0.4-1) ...
	Setting up node-write-file-atomic (3.0.3+~3.0.1-1) ...
	Setting up node-copy-concurrently (1.0.5-7) ...
	Setting up node-move-concurrently (1.0.1-2) ...
	Setting up node-gauge (2.7.4-1.1) ...
	Setting up node-normalize-package-data (3.0.0+~2.4.0-1) ...
	Setting up node-npmlog (4.1.2-2) ...
	Setting up node-cacache (15.0.5+~cs13.9.21-1) ...
	Setting up node-read-package-json (3.0.0-1) ...
	Setting up node-gyp (7.1.2-4) ...
	Setting up npm (7.5.2+ds-2) ...
	Processing triggers for man-db (2.9.4-2) ...

	hueadm search

image
image

	smguth@mycodo:~ $ hueadm search
	IP
	192.168.86.54

hueadm -H"IPADDRESS_OF_HUE" register user
hueadm -H 10.0.1.80 register dave
From https://github.com/bahamas10/hueadm


smguth@mycodo:~ hueadm lights > smguth@mycodo:~ hueadm -H “192.168.86.54” register user

  sending request... press the link button on the hue bridge
  error: Error: failed to register
      at /usr/local/lib/node_modules/hueadm/node_modules/hue-sdk/lib/create-user.js:47:10
      at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/hueadm/node_modules/hue-sdk/lib/request.js:24:7)
      at IncomingMessage.emit (events.js:326:22)
      at endReadableNT (_stream_readable.js:1241:12)
      at processTicksAndRejections (internal/process/task_queues.js:84:21) {
    _cmdlnInst: [CLI],
    _cmdlnSubcmd: 'register',
    _cmdlnHandler: [Function]

}

Note that you have to Physically push the button on the Hue after you execute this command
image

	smguth@mycodo:~ $ sudo hueadm -H "192.168.86.54" register user
	sending request... press the link button on the hue bridge
	-
	    success: {username: T76l8UYPFTAEIX1Hn3h9KFMopgH10o2auhdZjSPO}
	
	**Error in my documentation caused me to scratch my head for a while….**


	nano ~/.hueadm.json
	pasted my ipaddress and user string in the file follow the url's guide


GitHub - bahamas10/hueadm: A command line management interface to Philips hue

	First time I did this I used the Pi's address which is wrong..  This needs to be set to the Philip Hue Device's - Ip Address.


	Lies I am just guessing bother didn't work.
	Power cycled the device


image

	Meanwhile Port 80 works…

image

I’m stuck right here in the documentation But I think I’m close….

	Gonna power cycle the RaspberryPI 

smguth@mycodo:~ $ hueadm lights
error: Error: bad statusCode 404
at ClientRequest. (/usr/local/lib/node_modules/hueadm/node_modules/hue-sdk/lib/request.js:9:15)
at Object.onceWrapper (events.js:421:26)
at ClientRequest.emit (events.js:314:20)
at HTTPParser.parserOnIncomingClient (_http_client.js:601:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:122:17)
at Socket.socketOnData (_http_client.js:474:22)
at Socket.emit (events.js:314:20)
at addChunk (_stream_readable.js:297:12)
at readableAddChunk (_stream_readable.js:272:9)
at Socket.Readable.push (_stream_readable.js:213:10) {
code: 404,
statusCode: 404,
_cmdlnInst: [CLI],
_cmdlnSubcmd: ‘lights’,
_cmdlnHandler: [Function]
}

=========================================================================
Stoping step
hueadm lights, currently hung up when running the following:hueadm lights

	smguth@mycodo:~ $ **hueadm lights**
	error: Error: connect EHOSTUNREACH 192.168.86.207:80
	    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1138:16) {
	  errno: 'EHOSTUNREACH',
	  code: 'EHOSTUNREACH',
	  syscall: 'connect',
	  address: '192.168.86.207',
	  port: 80,
	  _cmdlnInst: [CLI],
	  _cmdlnSubcmd: 'lights',
	  _cmdlnHandler: [Function]
	}

Future steps
hueadm light 3 ON
hueadm light 3 green
hueadm light 3 red

I think I have to program in the lights so I’m going to start reading the manuals about that.

image
I wanted to note that it ran. 13.x because I didn’t hit the space bar before I could decide which version would be best. If there is a best even.

Also for the keen eyed


There is missing code here but it was becoming a challenge to meet the word max for characters on the post. I have kept the missing snip if it is helpful.

-Update
Found that the hueadm.json File I edited was incorrect

edit hueadm.json.
From:

To:


save and exit

Note names with spaces need to be enclosed in single ‘quotes’ to execute

Got into the admin client via ssh. I needed to be root

Nest Steps:
Issueing controls through Mycodo’s Web-UI.

Trouble shooting Note - I had a wifi usb plug that was unneccessary I noticed it gave me another interface and another IP address. So I had unplugged it which then changed my IP-address to what the Tasmota devices were not expecting. Inputs seemed to still work but I could not send controls (On/off) to the tasmota device. This produced the following error in the log daemon:

To remedy I tried to statically set my ip-address on the Raspberry pi

sudo nano /etc/dhcpcd.conf
interface eth0
static routers=192.168.##.1
static domain_name_servers=192.168.##.1
static ip_address=192.186.##.##/24

This didn’t work after a reboot and

smguth@mycodo:~ $ hostname -I
192.168.##.##-OLD_IP still :frowning:

But I set it statically in my router and between those two changes my IP address was changed and this resolved the ERROR and controls work again.

Nest Steps:
Issueing controls through Mycodo’s Web-UI.

So i’m looking to get Philips Hue ligths integrated intot Mycod’s UI and I cam accross the following:

kizniche commented on Dec 13, 2019
Conditionals are pretty powerful and can be programmed to do all you mentioned. Conditionals are programmed in Python 3. You can use subsystem to execute hueadm, unless there’s a python library that would make it easier/more secure.
Found some libraries:
GitHub - studioimaginaire/phue: A Python library for the Philips Hue system
GitHub - quentinsf/qhue: A very lightweight Python wrapper to the Philips Hue API
GitHub - issackelly/python-hue: Python client for Philips Hue -- determined via API reverse engineering

https://github.com/adamcharnock/python-hue-clie
kizniche commented on Dec 13, 2019
Looks like phue is the most feature-rich and up-to-date library that’s actively maintained. I’d suggest testing this library for use in Conditionals, as it’s in the native language used by Mycodo.

Owner
kizniche commented on May 13, 2020
I’ve been working on a new feature for the 8.5.0 release that allows custom output modules to be imported, which will allow user-created, single-file output modules to be used. This will enable rapid-prototyping and deployment of new output modules for use in Mycodo. This issue is a perfect candidate for using the new output system and I’d like to help develop an output module for these lights. There will likely be some tweaking that needs to go on behind the scenes to allow color to be passed to an output module, but the heavy lifting has mostly been done.

So I found that info while trying to set up the web-ui

image

I’m thinking I should create my script named script_on_off.sh and have it able to accept the on and off arguements. I wanted to check that this is the recommended approach as I didn’t have a working example to go off of.

Thanks,
Scott G.