Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get all the sonoff POW2 power meter switches into useful places #1109

Closed
goatchurchprime opened this issue Apr 14, 2019 · 21 comments

Comments

Projects
None yet
4 participants
@goatchurchprime
Copy link
Contributor

commented Apr 14, 2019

@ajlennon has flashed a huge number of sonoff pow2s and sonoff switches on his desk with the espurna firmware.

We need to wire these up and deploy them to various power hungry and interesting devices around the room, such as on both laser cutters (issue #989), and get them to interface to the mqtt.local broker.

Keep the current instructions up to date here:
https://github.com/DoESLiverpool/somebody-should/wiki/MQTT-services

@ajlennon

This comment has been minimized.

Copy link
Contributor

commented Apr 14, 2019

Right back atcha! ;)

@goatchurchprime

This comment has been minimized.

Copy link
Contributor Author

commented Apr 14, 2019

One of the problems here is it's supposed to use mDNS but doesn't seem to work https://github.com/xoseperez/espurna/search?q=mdns&type=Commits

so I've connected it to the flakey DoESLiverpool-MQTT wifi network so that the ip number of the broker is stable and can be encoded in as mqtt.local for 10.3.141.1

Unfortunately there are two problems: (1) the wifi signal is weaker than if we used the DoESLiverpool network, (2) your PC needs to be on the DoESLiverpool-MQTT network to connect to the espurna dashboard.

We need to get the mDNS thing sorted out for these devices.

@johnmckerrell

This comment has been minimized.

Copy link
Member

commented Apr 14, 2019

@ajlennon

This comment has been minimized.

Copy link
Contributor

commented Apr 14, 2019

I suggested we have some unchanging IPs delivered from the DHCP server to these devices which should be easy enough.

Then rather than keep tabs on all these IPs I was suggesting an internal DNS to resolve the names to those IPs

@ajlennon

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2019

OK so we've investigated and the issue is the standard ESPurna build isn't configured to support client side host name resolution via mDNS. We'll need to rebuild it

https://github.com/xoseperez/espurna/blob/5d5e9155e561a92897f7c6130fbbe7dedfbffac5/code/espurna/config/general.h#L585

@goatchurchprime

This comment has been minimized.

Copy link
Contributor Author

commented Apr 15, 2019

(wiki is updated with latest known ip numbers of brokers on each wifi network)

Current list of plugs are:

ESPURNA-8E010B is on a long black kettle lead powering the VR computer in the main room and logged onto DoESLiverpool-MQTT network

ESPURNA-8E30FD is on a very long white mains socket extension cable powering Sophia laser cutter and on the DoESLiverpool network

ESPURNA_4EAD1D is a short mains power plug and one of the original SonoffPOW devices where the power readings are quite noisy.

@amcewen

This comment has been minimized.

Copy link
Member

commented Apr 15, 2019

A reminder to people experimenting with remotely operated mains switches that we need to comply with Rule 0.

Luckily this time I came back to my desk in time to intervene and unplug @ajlennon's coffee roaster before @goatchurchprime had managed to set the beans on fire, they were just smoking lots...

Presumably all the people laser-cutting, etc. won't be too happy if their cuts can be remotely interrupted by someone accidentally sending the wrong MQTT command either...

** I've filed a request to espurna for exactly this feature xoseperez/espurna#1697 -- @goatchurchprime

@ajlennon

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2019

Yikes. I need to password protect this stuff.

@amcewen

This comment has been minimized.

Copy link
Member

commented Apr 15, 2019

Yes. Yes you do. It would be good to have some thoughts around security on all the other ones too, while you and @goatchurchprime are still enthused by the project and likely to do something about it...

Your beans are on the fire escape (in case I forget to bring them back in once they've cooled down).

@ajlennon

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2019

Why was he experimenting with my coffee roaster? Or shouldn't I ask? Can't we stick with a lamp or something for now?

@ajlennon

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2019

Mind you it's nice to know the heater does something :))))))

@ajlennon

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2019

@goatchurchprime VR PC SonOff is updated and now has build which supports mDNS i.e. mqtt.local name resolution for broker

@goatchurchprime

This comment has been minimized.

Copy link
Contributor Author

commented Apr 15, 2019

The clone of the whole repo with this single one-byte change is here: https://github.com/DynamicDevices/espurna

Can the compiled binary be uploaded into the "Releases" tab, or would this be too confusing. Needs a binary built for both the sonoff basic and the sonoff pow2.

@ajlennon

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2019

I think somebody should work out what the difference is between OTA and non-OTA binaries and if there's one we can use that doesn't bugger up the settings first

@goatchurchprime

This comment has been minimized.

Copy link
Contributor Author

commented Apr 15, 2019

I've plugged the coffee machine onto the POW1 and used the web-interface to set a Schedule of going off at 21:35 and on at 8:00 (The UTC option is buggy. Leave it off and look at its local time to work this out relative to, which is one hour ahead. I've verified that the schedule feature does work, so we can lose the timer switch.)

We should convert this to a POW2 when we have some better data recording and graphing. It's then a small programming project to make the node-red flows that will detect when the water gets boiled and then let the remaining coffee go cold after six hours. We'll need the sonoff stuck to the machine so that you can push that switch to turn it on instead of the one behind the pot.

@ajlennon

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2019

UTC buggy? Seems unlikely. Is there an issue in the repo? Perhaps we should update the f/w?

You were going to put a POW2 and a POW in parallel or something to compare readings. Do we have any results on that? Can we still do that on the coffee pot?

@ajlennon

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2019

I reckon that the coffee is stewed within a much shorter period than 6 hours. We could investigate and switch off when the coffee is no longer drinkable...

@ajlennon

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2019

What about a relay switch behind the coffee filter holder that puts it on when it's inserted?

@goatchurchprime

This comment has been minimized.

Copy link
Contributor Author

commented Apr 16, 2019

I've plugged the coffee machine onto the POW1 and used the web-interface to set a Schedule of going off at 21:35 and on at 8:00 (The UTC option is buggy. Leave it off and look at its local time to work this out relative to, which is one hour ahead. I've verified that the schedule feature does work, so we can lose the timer switch.)

We should convert this to a POW2 when we have some better data recording and graphing. It's then a small programming project to make the node-red flows that will detect when the water gets boiled and then let the remaining coffee go cold after six hours. We'll need the sonoff stuck to the machine so that you can push that switch to turn it on instead of the one behind the pot.

@ajlennon

This comment has been minimized.

Copy link
Contributor

commented Apr 16, 2019

I have both a POW1 and a POW2 on the coffee pot now...

@ajlennon

This comment has been minimized.

Copy link
Contributor

commented Apr 19, 2019

I would say this is done for now so closing

@ajlennon ajlennon closed this Apr 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.