For help, advice and discussion about stuff not related to aviation. Play nice: no religion, no politics and no axe grinding please.
  • 1
  • 23
  • 24
  • 25
  • 26
  • 27
  • 31
By Colonel Panic
#1870437
Problem with nohup

My oil tank measuring Raspberry Pi has been intercepting and forwarding data to Home Assistant for many months, but now it keeps stopping; to re-start it I a) type sudo ./jjbwatchman.sh then wait a few minutes for some Terminal lines to appear, then in a second Terminal window b) type sudo nohup ./jjbwatchman.sh &

After up to 17 minutes the new data comes through to Home Assistant as expected. Until I close the two Terminal windows :? . Why might this be, as I had thought that the nohup command was supposed to prevent this.

TIA

Image
User avatar
By stevelup
FLYER Club Member  FLYER Club Member
#1870442
You're running the same thing twice.

When you do the first one, that actually starts it.

When you do the second one, it can't start because it's already running and has locked access to the USB device / network ports / everything else.

... but it's that second one that's the only one that can survive the terminal window closing because that's the one you nohupped and sent to background. So then, when you close the terminal window, the first one is terminated, but the second one which could theoretically survive has in fact already died.

So the quick answer is to just do the second one...

sudo nohup ./jjbwatchman.sh &

... then close the window. Don't do the non-nohup one first.

A proper solution is to make this into a systemd script so it automatically launches (and re-launches if it crashes). It then becomes completely autonomous and you'll never need to touch it again.

I can't begin to talk you through this, I think we'd both end up killing each other and the forum software would explode, but I'm more than happy to remote on and do it for you whilst you watch if you like.

If you want to do this e-mail me!
Colonel Panic liked this
User avatar
By OCB
#1875253
Any opinion on Tuya + Home-Assistant here?

I don't have the time (wish I had!) to be a real "under the hood" hardcore tinkerer, setting up all kinds of IoT and domotics - but I do desperately want to get a handle on my water/gas/leccy consumption.

All are on dumb old style rotating counter meters.

I'd come across Tuya a long time back, but for whatever reason I binned it as an idea that could solve my problems.

I now see that it's looking better, and there are potentially a couple of other vendors/platforms that could potentially read from "dumb" meters (although gas seems to be the tricky one), although I do like the look of Tuya + Home-Assistant.
By Colonel Panic
#1875264
I have several "Tuya" things integrated (curtains / blinds / smart plugs / LED strings) in to my Home Assistant setup, although until now I have tended to use the SmartLife app rather than the Tuya app as a mid point.

The latest release of Home Assistant (2021-10-xx) brings "native" GUI integration for Tuya, so may well re-look at this.

The new Energy section of HA has great promise; I integrate my PV, Powerwall & Grid electricity in to mine, don't have gas, and would like to bring in my oil usage (maybe fudge it as "gas"?), using a rudimentary RPi to intercept oil tank quantity remaining (rather than flow).

Monitoring water usage is also a difficult one for me - the meter is a way away up by the road, with no chance of fitting a flow meter.
OCB liked this
User avatar
By OCB
#1875460
Oh gawd - I feel myself getting pulled into the hell that is “electronics tinkering” again….

…for years I’ve peeked down the various rabbit holes called Arduino, RaspberryPi, Zigbee, GitHub, Thingiverse, Instructibles etc - all backed up by copious amounts of University of YouTube + AliExpress misery…but taken a few steps back most of the time.

Maybe I’m being too defeatist - but I see them (for me at least) as time devouring and frustration generating activities :oops:

That said - I have found someone who did a better job than I did of using cameras and OCR to read utility meters….although first I might try and see if I can utilise Hall Effect sensors for my water and gas meters…
User avatar
By OCB
#1875462
Colonel Panic wrote:
Monitoring water usage is also a difficult one for me - the meter is a way away up by the road, with no chance of fitting a flow meter.


There is at least one Tuya ultrasonic water flow meter, and a few more IoT flow meters out there - couldn’t you just whack one on where the feed comes into the property?
Colonel Panic liked this
By Colonel Panic
#1875469
I could, but the meter is ~100 metres away from the house, and I'd have liked to have monitored leaks between here and there. But one in the house would be of some use I suppose.
User avatar
By OCB
#1875530
Right - I know this is taking things at a tangent on this post - but here goes:

Question to everyone.

What do they want from "home automation"?

What "works" now in terms of tech and vendors etc.

What doesn't work.

What would be the Utopia Scenario?

I've been following "domotics" from back in the X10 days, but this field has always been (IMHO) held back by the "solution looking for a problem" syndrome, "tinker level" being too high even for the most basic user, and a general lack of positive direction.

I see on YouTube plenty of gents showing off their automated lighting, geolocated turning on and off of their heating and lighting, setting up "scenes" for cinema night in the living room etc, with blinds and curtains all in synch like some home version of Disney on Ice (or maybe meth...but let's not go there).

Maybe I'm an old phart - but I genuinely don't need a "smart lightbulb" when the dumb owner has next to no advantage from just prodding the "off switch"with his scrawny old finger when he wants the lights off in the living room to watch a film.....

Now, having near real-time reporting of gas/leccy/water usage + per room monitoring of temp/rH/CO2 with the ability to also alert if there's a fire + out of limits carbon monoxide/radon/PM2.5 etc...that's useful.

Spending a wad of cash + time on having a motorised opening of my bedroom curtains?

Meh....
skydriller liked this
User avatar
By rikur_
FLYER Club Member  FLYER Club Member
#1875565
I started dabbling in home automation in ~ 2003 using X10 and a windows NT server, an SMS gateway, and a few bits of soldering.

My first project was the ability to switch the central heating on/off by (a) text message; (b) a more sophisticate schedule than the weekdays vs weekends allowed by the wall timers of the time. At the time we were 'dual income no kids' and had very little pattern to when we were at home. The aim was to be able to reduce the amount we heated the house, whilst being able to return from a weekend away to a nice warm house.

We quickly added to it a few 'smart' lights to replace the then mechanical timers that back then had to be adjusted every few weeks for changing sunrise/sunset times.

Next was adding remote switches. Things like garden flood lights, pond pump, etc all had their wiring and traditional switches in completely the wrong places, so adding several remote control switches in the right place meant we could e.g. switch on the flood light next to the back door.

Somewhere along the way I added a basic web front end, so that I could control this all from my Motorola Razr phone, which started the shift from controlling things remotely or to schedule, to being lazy in the house itself. No need to leave the sofa to put the heating on, turn the living room lights down, etc. It's also when it started to get the 'wow' reactions from friends, rather than being geeky.

Since then it's evolved, and I finally eliminated X10 only a couple of years ago. What do I have now and why?
- Nest in main house, hive in house #2:

- Hive is doing heating and lighting, primarily so that we can reduce heating the place when we're not there, and warm it up before we arrive. Lights mostly for security to give the impression of it being occupied. I've disabled all the geofencing stuff, and just do it manually (at times of the year it needs 12 hours pre-heating before we arrive, but geofence would only trigger a few minutes before we arrive). I've had no real reliability issues with Hive, but two gripes: (a) the scheduling capability really struggles to mix 'events' (like sunrise) with fixed times - e.g. if you want a light on from 6am until sunrise, when sunrise gets before 6am, it just comes on all day!; (b) it uses batteries in the thermostat, which invariably go when we're not there, losing the ability to remote control it.

- Nest is just doing (legacy) heating/hot water. I use the geofence stuff as fall-back to disable it (if we're away for more than 48 hours it stops heating the water for example). Nest works fine for me, but relatives have struggled with the bluetooth range from the thermostat to the control unit in larger houses.

- I've got quite a lot of smart plugs/smart light switches, mostly turning lights on at sunset, off at 11pm etc. A few are for remote control purposes - e.g. the floodlights on our garage/outbuilding are wired from the outbuilding itself - but the remote switch allows me to switch them on/off from the house. The living room lights are smart for laziness, can remain on the sofa and change from e.g. reading mode to tv watching mode. With 8 different lighting circuits in the living room (spots, wall lights, lamps, etc), it's also easier than twiddling 8 dimmer switches to get the combination that you want. This is mostly sonoff stuff.

- I've got a remote control skylight. Think of this as an extension of the heating controls, opening to help cool the house on warm days, or closing it when heating or air conditioning is on.

- All our aircon units have their own Mitsubishi internet control. Primarily use this for setting elaborate schedules, or to warm/cool the house before returning home. When we're in the house we just tend to use the wall controls.

- I've got a CT clip smart meter, with three different clips for mains, airsource, and garden. This has been a bit of an eye opener to things that use more electricity than you'd think, or simply things that have been left on by accident (!) Undoubtedly saved us some money. This is an efergy device, which I wouldn't recommend!

- I've got some Broadlink 'universal remotes' primarily to control hifi (being a separates person, this gives me e.g. one touch amp & tuner switch on, and also put the amp in the right mode etc). Also allows us to control the garden audio, which is actually running from a hifi deep in the house.

- House alarm is Eaton in one house, Texecom in the other, both with their own smart services. Don't really use this to control them, primarily it is for the remote notification that they've triggered. However, you can see e.g. when the kids get home from school and switch the alarm off which is a bit big brother. The Eaton also gives a log of main supply status/voltage which is occasionally handy.

- We're on our second smart washing machine. Frankly I just don't see the point. The first one was NFC, so you physically had to touch your phone against it to remote control it anyway. More recent one is WiFi. It's slightly useful to get the push notification that it's finished the cycle and time to hang the washing out I suppose. I'm looking at the Bosch smart ovens though, as I think being able to remotely put dinner on would be useful.

I've probably missed some bits, but that's the bulk of it.
OCB, Flyin'Dutch', Colonel Panic and 1 others liked this
By Colonel Panic
#1875635
OCB wrote:What do they want from "home automation"?

    For me, best bang for buck for me has been motorising & automating curtains. Even better when you can set times to "SS+15" etc. My bedroom curtains open 5% at 07:10, 10% at 07:20, and then 100% at 07:30 - bliss. And not having to go around each evening closing curtains is surprisingly rewarding.
    Next has been being able to open/close garage & barn doors & the gate
    Then comes lighting, again making good use of SS & SR variations etc
    Smart plugs - putting timers on things like washing m/c & dishwasher
    Other than that, I like being able to bring a load of "controls" in to one "dashboard", whether it is all of the above, plus status of oil tank, heating etc etc
    TBH I haven't done much by way of automation per se (ie "when X arrives home, turn on Y", but I do enjoy the ability to control & monitor things from a central point - whether at home or away. I'd love to work out a way of automating the drive gate to open when I am 500m away, but not sure how to code it in Home Assistant without it opening when I am leaving rather than just arriving...
    I also enjoy the new "Energy" function within HA, which shows electricity usage / PV / Powerwall etc. See screenshot below of today's figures.
What "works" now in terms of tech and vendors etc.

If you are in the Apple ecosystem then Homekit (including Homebridge) is easy to set up & use, looks "nice", but I fairly quickly found it all too limiting. Home Assistant is great, but it is a tinkerers paradise and whilst improving isn't "easy". My HA started out running on a RaspberryPi, but fairly quickly found it a bit slow, so splashed out on a dedicated Intel NUC - which has worked flawlessly. (The NUC that is, not HA :( )

What doesn't work.

    "Tuya"/SmartThings smart plugs (most of mine are branded Techin) work well
    Shelly do a load of widgets which are small, cheap and customisable
    Hue gets a load of criticism for being a closed system & expensive, but I am happy with their products. Do look for Black Friday type discounts though.
    I have a bit of IKEA Tradfri stuff (bulbs / blinds) and it works well.


Image
By Colonel Panic
#1887664
iCloud Private Relay

I have a static external IP address as provided by PlusNet, but when I run a WhatIsMyIP check it says that my external IP address is something different, with the ISP shown as "iCloud Private Relay".

How do these two "things" work together / compete with one another? Should I turn something off, and if so, what ...

TIA
  • 1
  • 23
  • 24
  • 25
  • 26
  • 27
  • 31