Page 2 of 3

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Saturday 25 July 2015 15:30
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

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Saturday 25 July 2015 15:38
by RayAmsterdam

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Saturday 25 July 2015 16:41
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 :(

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Tuesday 28 July 2015 16:24
by jadijkstra2000
Anyone using switches and showing status of picoups?

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Wednesday 03 February 2016 12:01
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)

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Sunday 13 March 2016 16:20
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 ...

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Sunday 13 March 2016 16:23
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 ...

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Sunday 13 March 2016 17:42
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.

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Sunday 13 March 2016 17:45
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?

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

Posted: Sunday 13 March 2016 21:09
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.

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Monday 14 March 2016 0:01
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 :)

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Monday 14 March 2016 11:44
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?

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Monday 14 March 2016 13:25
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

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Monday 14 March 2016 13:50
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.

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Monday 14 March 2016 13:55
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

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Monday 14 March 2016 16:17
by Scones
Yes please. Other than the LED's and buttons I've done very little so far

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Monday 14 March 2016 17:39
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

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Monday 14 March 2016 19:29
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

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Tuesday 15 March 2016 10:51
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.

Re: Anyone using/designed a Raspberry Pi UPS?

Posted: Saturday 13 August 2016 22:18
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)