Anyone using/designed a Raspberry Pi UPS?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by jvdz »

I have used this webpage from their forum to install it: http://www.forum.pimodules.com/viewtopic.php?f=12&t=212

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
RayAmsterdam
Posts: 115
Joined: Sunday 11 January 2015 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by RayAmsterdam »

jadijkstra2000
Posts: 58
Joined: Monday 26 May 2014 10:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by jadijkstra2000 »

Yeah, those already done :)

The UPS is working fine, but I would like to have the monitored state in Domoticz.
Thought the question was about that...

But an other thing, maybe someone knows, I have the PiCO UPS and on top of that a PiFace 2.
The first run, it saw the PiFace correctly, but after a few reboots it cannot find it anymore :(
jadijkstra2000
Posts: 58
Joined: Monday 26 May 2014 10:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by jadijkstra2000 »

Anyone using switches and showing status of picoups?
Scones
Posts: 47
Joined: Wednesday 10 December 2014 16:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by Scones »

Has anyone done anything with this yet?

I'm wondering what is the best way to represent this in Domoticz. I would like to represent the Power supply - mains vs battery and the battery level either as a percentage or as a voltage as a single device. I would then still like to be able to monitor both within LUA.

Am I asking too much? I could add a dummy hardware On/Off switch for the power state, and a dummy hardware percentage or voltage for the battery level. Is this the best way to go?

I'm writing a small perl script to read the state of the UPS PIco and can use JSON to update Domoticz. Presumably this is the best way to do that

Update: I've tried using a Dummy Hardware dimmer as this hs both an On/Off State and a Slider for the battery level. However, I can't set the level using JSON (and I can't change the icon)
User avatar
jfhautenauven
Posts: 17
Joined: Sunday 13 March 2016 16:09
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Belgium
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by jfhautenauven »

Hello,

Still interested in UPS Pico Stuff?

Here is what I got in attachment

Values updated using python scripts

If interested I could make a post on the forum with my .py files ...

Let me know ...
Attachments
Capture1.JPG
Capture1.JPG (60.87 KiB) Viewed 2631 times
Capture2.JPG
Capture2.JPG (54.69 KiB) Viewed 2631 times
User avatar
jfhautenauven
Posts: 17
Joined: Sunday 13 March 2016 16:09
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Belgium
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by jfhautenauven »

Oh and by the way, also made scripts to control the LED on the UPS Pico ...

I think I will soon implement to get BUTTON A and BUTTON B linked to domoticz ...
RayAmsterdam
Posts: 115
Joined: Sunday 11 January 2015 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by RayAmsterdam »

jfhautenauven wrote:Hello,

Still interested in UPS Pico Stuff?

Here is what I got in attachment

Values updated using python scripts

If interested I could make a post on the forum with my .py files ...

Let me know ...
I am interested. Maybe you can make a wiki.
User avatar
jfhautenauven
Posts: 17
Joined: Sunday 13 March 2016 16:09
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Belgium
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by jfhautenauven »

Hello,

I would be glad to do so ...

Making a wiki on the domoticz wiki ? Is it possible for anyone to create one?
RayAmsterdam
Posts: 115
Joined: Sunday 11 January 2015 16:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: RE: Re: Anyone using/designed a Raspberry Pi UPS?

Post by RayAmsterdam »

jfhautenauven wrote:Hello,

I would be glad to do so ...

Making a wiki on the domoticz wiki ? Is it possible for anyone to create one?
Yes it is.
User avatar
jfhautenauven
Posts: 17
Joined: Sunday 13 March 2016 16:09
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Belgium
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by jfhautenauven »

Will look into as soon as I have a bit of time.
Maybe tomorrow. Need to clean stuff in the code before I give it on the wiki :)
Scones
Posts: 47
Joined: Wednesday 10 December 2014 16:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by Scones »

I would also like to see this. I've also started coding for this and would love to compare. I'm particularly interested in things like the battery percentage.

I've also written code for the LEDS, as well as the buttons. I use the LEDS as an intruder alarm status. Off = Off, Blue = armed, red = triggered.

I have a single daemon that polls the various registers and uses JSON to update Domoticz. One of the bits I'm struggling with is the best dummy devices in Domoticz to represent the different sensors. Which devices have you used for the mains and battery voltages?

I have the extended life battery and want the Pi to stay powered up for as long as possible so that it can monitor the power cut and act accordingly (My router is also UPS protected and I want to be able to monitor the power cut if I'm not home).

I'm looking at a way of letting Domoticz decide if / when it should be shut down depending on the battery state. Anyone got any ideas?
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by jvdz »

I am interested too in this :)
Scones wrote: I'm looking at a way of letting Domoticz decide if / when it should be shut down depending on the battery state. Anyone got any ideas?
Wondering why you would need to do this as the Pi UPS will issue a shutdown command whenever it reaches the battery threshold set... right?

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Scones
Posts: 47
Joined: Wednesday 10 December 2014 16:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by Scones »

jvdz wrote:I am interested too in this :)
Scones wrote: I'm looking at a way of letting Domoticz decide if / when it should be shut down depending on the battery state. Anyone got any ideas?
Wondering why you would need to do this as the Pi UPS will issue a shutdown command whenever it reaches the battery threshold set... right?

Jos
Jos

As I understand it, the default action is for the UPS to shut down the Pi 30 seconds after power fails (manual says 120 seconds, but I'm sure mine arrived set to 30).

If you disable this (I think you set the time register to 255) it will then carry on until the battery drops below 3.5v before shutting down the Pi.

I think the shutdown process either way is that it triggers the FSSD shutdown script using a GPIO pin. It then waits a number of seconds to allow the Pi to do a tidy shutdown before killing power.

It would be possible to add the code I wish to run first to the FSSD daemon, and this would be a tidy way to do it. However, I'm not sure how much time I have between the pin being set and the power going off.

As these actions would include sending an email, I would need some means of pre-empting this action, or even triggering it.

One option I've just considered, is adding code the the daemon that is already running to monitor the registers and update Domoticz. e.g.

if (running on battery) and (voltage > 3.8v) then
run whatever code I want
send email notifying of battery fail and shutdown
update the fssd_batime register 0x6b 09 to 15 (minimum allowed value)
end

After 15 seconds, the UPS would then start the normal FSSD shutdown.
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by jvdz »

I think you are correct, but I remember I did several changes to the config to only start the shutdown process after the battery gets below a certain capacity, which in my mind should be the standard behavior of a UPS.
Will be able to check the details of my config later today in case you are interested in the config changes I made.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Scones
Posts: 47
Joined: Wednesday 10 December 2014 16:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by Scones »

Yes please. Other than the LED's and buttons I've done very little so far
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by jvdz »

Not sure whether you have seen this pdf on their site but it is quite nice as a guide to set it up: http://www.pimodules.com/_pdf/Simple_Se ... S_PIco.pdf
Page 16 talks about the default 30 seconds and how to change that. I have done this as mentioned on that page:
To set the run time to maximum e.g. the run time of the batttery, use the following command. This will keep the Pi powered until the battery discharges to 3.5V, at which point it will shut the Pi down.
i2cset -y 1 0x6b 9 0xff
Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
User avatar
jfhautenauven
Posts: 17
Joined: Sunday 13 March 2016 16:09
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Belgium
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by jfhautenauven »

The wiki page is coming :D

http://www.domoticz.com/wiki/UPS_Pico

I'm trying to cover every aspect of this and if I got some time, I will also put personal improvements to the standard install and set up procedure.
For example, having the FSSD script to be run as a service, checked by monit and restarted if it dies, which can happen when there is GPIO conflict between the script and domoticz for example. Or any other software using of configuring GPIO's
Also a better way to implement the hwclock using crontab to keep the RTC synced when ntp and network are available etc.

I hope that my guide will be a little bit clearer than the stuff in the manual

Please be patient, I'm not used to writing Wiki stuff with the editor provided. At work we have a WYSWYG type of editor that simplifies a lot the task, so still getting used to it.

I should have written the main parts for tomorrow I guess
Scones
Posts: 47
Joined: Wednesday 10 December 2014 16:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by Scones »

jvdz wrote:Not sure whether you have seen this pdf
Jos
Thanks for this. Yes, I have that one, as well as a fuller instruction manual, and a FAQ. Unfortunately,in places they contradict each other, and at time themselves.

Controlling the UPS board is going to be quite easy as I think they've designed the interface very well. The bit I still haven't decided on yet is how I want to manage it. I think the pseudo code I posted is probably how I'm going to do it.

I've got a number of these UPS boards with the long life batteries, as I'm also going to use one to power my robot, or at least the Pi running my robot and one will power the Pi for a portable Squeezeplug player.

I've also got another one which I'm going to play with on a spare Pi which I don't mind stuffing. I'm planning on playing with this, to see what works best.
jadijkstra2000
Posts: 58
Joined: Monday 26 May 2014 10:18
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Anyone using/designed a Raspberry Pi UPS?

Post by jadijkstra2000 »

I have a problem with Pico UPS since the beginning, Maybe anyone has an idea about this...

UPS Pico RPI Voltage : 5.150 Volts (That's OK!)
UPS Pico Power Source : RPIPowered (That's OK!)
UPS Pico Battery Voltage : 0.000 V (NOT OK)
UPS Pico Battery Level : -425 % (NOT OK)

What can this be...?

(Battery is OK, when I read the values from command line they are OK)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest