Page 1 of 1

UPS Pico + Domoticz integration | New wiki page

Posted: Monday 14 March 2016 23:05
by jfhautenauven
This article is about the integration of UPS Pico from pimodules.com with domoticz

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

The tutorial is almost complete, I still need to give examples with domoticz switches, selector and blockly

Please if someone tests it and finds errors or wrong information, please advise me :D

Re: UPS Pico + Domoticz integration | New wiki page

Posted: Tuesday 15 March 2016 20:54
by RayAmsterdam
Looks promising! I will check it next week.

Re: UPS Pico + Domoticz integration | New wiki page

Posted: Wednesday 16 March 2016 15:35
by jfhautenauven
Almost finished the full tutorial ... Double checking what I wrote right now ...

I added a changelog on the page for when I make modifications that could interest people that followed the guide previously or want to update their scripts

Re: UPS Pico + Domoticz integration | New wiki page

Posted: Sunday 20 March 2016 16:43
by lagus
Mr jfhautenauven
I appreciate the time you have taken to write down how to "integrate" the UPS pico into Domoticz!
I have been looking for this a while for my 1765km away, fully automated summer house. Because at that distance monitoring the Pi itself and environment data around it gets even more important the further away it is.

I was able to follow the setup guide and then started to implement your update script.
Every time I'm running it though I get an error:

Code: Select all

python upspico-and-domoticz.py                                                                                          
Traceback (most recent call last):
  File "upspico-and-domoticz.py", line 18, in <module>
    idx_PoweringMode = XX
NameError: name 'XX' is not defined
This is how that part in the script looks like:

Code: Select all

# change these values
# domoticz = URL to the Domoticz server
# idx_ are the id's of the devices corresponding to the data in domoticz
domoticz = "http://127.0.0.1:8080"
idx_PoweringMode = XX
idx_BatteryVoltage = XX
idx_RpiVoltage = XX
idx_BatteryTemperature = XX
idx_RpiFanTemperature = XX
idx_FirmwareVersion = XX
idx_BatteryActiveSignal = XX
idx_BatteryLevelPercentage = XX
idx_BatteryChargerStatus = XX
# End 
And the devices part in Domoticz:
Image

Newbee as I am to coding Python (or any coding) I don't really know how to make this script work.
Would you maybe care to show how your's look like and I can try to mimic your works?

Thanks so very much!
//Robert

b.t.w. I got the led and buzzer working like a charm!
I don't have the fan part, so couldn't try that.

Re: UPS Pico + Domoticz integration | New wiki page

Posted: Sunday 20 March 2016 17:31
by lagus
Mr jfhautenauven,

I owe you an apology.
Your description is correct and superb.
I missed as you probably seen to enter the idx values in the script which device to be updated.
After a re-update and added *ALL* sensors and values that your script reads it works perfectly well.

Again, thank you very much for this excellent guide!
Best,
//Robert

Re: UPS Pico + Domoticz integration | New wiki page

Posted: Sunday 20 March 2016 22:31
by jfhautenauven
lagus wrote:Mr jfhautenauven,

I owe you an apology.
Your description is correct and superb.
I missed as you probably seen to enter the idx values in the script which device to be updated.
After a re-update and added *ALL* sensors and values that your script reads it works perfectly well.

Again, thank you very much for this excellent guide!
Best,
//Robert
Hello Robert,

No problem, yeah indeed when I read the post on my smartphone I had seen your little mistake with the IDX numbers, sorry to reply so late but I hate to use the phone to reply because it's too tiny :)

Thanks for trying my scripts and following the wiki tutorial and also thanks for the feedback :)

If you find anything incorrect in the script or the wiki, please advise and I'll correct according to your obeservation :)

Best regards,

JF

Re: UPS Pico + Domoticz integration | New wiki page

Posted: Thursday 03 November 2016 15:21
by rammstan
Hello, Salut,

Can i use the pico and the piface at the same time?

May be a conflict possible?

Thks for your advice.

JL

Re: UPS Pico + Domoticz integration | New wiki page

Posted: Saturday 04 March 2017 21:56
by Ericv
Hi,

I tried to follow your instructions for upgrading the Pico firmware (HV3.0).

I could only get this done after stopping the daemon;

Code: Select all

sudo /etc/init.d/picofssd stop

Re: UPS Pico + Domoticz integration | New wiki page

Posted: Monday 20 November 2017 22:23
by DutchDomoticz
Hi there,

I am relatively new to the Raspberry Pi and Domoticz and I am following your post on how to install the UPS PIco HV3.0A Top End on my Raspberry Pi 3 in combination with Domoticz.

I have found that at first when I check if i2c is running with the command below I didn't get a response. Only after some searching I discovered that I needed to push the "UR" button on the PIco UPS to get i2c running and be able to see the device. I am not sure it is correct that I need to do this to get i2c running.

Code: Select all

sudo i2cdetect -y 1
Now after installing the python scripts I tried to check the details of my PIco UPS with the command below.

Code: Select all

sudo python pico_status.py
This gives me the following output:

Code: Select all

***********************************
  UPS PIco Firmware: ff
  Powering Mode: ERR
  BAT Volatge:
Traceback (most recent call last):
  File "pico_status.py", line 74, in <module>
    print " ","BAT Volatge:", bat_level(),"V"
  File "pico_status.py", line 31, in bat_level
    return (float(data) / 100) ValueError: could not convert string to 
float: ffff
It is clear that the script isn't working correctly, but I have no idea in which direction I should look to solve this. Maybe you can help me by giving a hint? Much appreciated.

Re: UPS Pico + Domoticz integration | New wiki page

Posted: Friday 24 November 2017 22:41
by DutchDomoticz
Back again,

I have restarted from scratch.
Started with an image file "domoticz-raspberrypi-sdcard-4834.img". This has kernel 4.1.18-v7+ #846.
Used the PIco installer script created by Siewert https://github.com/Siewert308SW/pico_installer.
The install ran successful, but after reboot I got an error message in /etc/rc.local.
After commenting out this line:

Code: Select all

#echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device ( sleep 4; hwclock -s ) &
And adding this line:

Code: Select all

sleep 4;hwclock -s &
Things seemed to be OK and I could successfully see the status of the PIco UPS.
The firmware version of the UPS is 0x18.
When trying to update the UPS firmware using the PIco installer script created by Siewert I get an error message saying "/dev/serial0 not found".

It seems to me like there is an incompatibility between the kernel version and the code in the script which prevents it from communicating with the UPS to do the firmware update.

I would love to hear anybody's thoughts on how to get further.
Ideally I want to update the UPS firmware to 0x38, update the kernel to the latest 4.9 version and finally be able to run domoticz again :)

Regards,
Dick

Re: UPS Pico + Domoticz integration | New wiki page

Posted: Friday 24 November 2017 22:57
by Siewert308SW
DutchDomoticz wrote: Friday 24 November 2017 22:41 Back again,

I have restarted from scratch.
Started with an image file "domoticz-raspberrypi-sdcard-4834.img". This has kernel 4.1.18-v7+ #846.
Used the PIco installer script created by Siewert https://github.com/Siewert308SW/pico_installer.
The install ran successful, but after reboot I got an error message in /etc/rc.local.
After commenting out this line:

Code: Select all

#echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device ( sleep 4; hwclock -s ) &
And adding this line:

Code: Select all

sleep 4;hwclock -s &
Things seemed to be OK and I could successfully see the status of the PIco UPS.
The firmware version of the UPS is 0x18.
When trying to update the UPS firmware using the PIco installer script created by Siewert I get an error message saying "/dev/serial0 not found".

It seems to me like there is an incompatibility between the kernel version and the code in the script which prevents it from communicating with the UPS to do the firmware update.

I would love to hear anybody's thoughts on how to get further.
Ideally I want to update the UPS firmware to 0x38, update the kernel to the latest 4.9 version and finally be able to run domoticz again :)

Regards,
Dick
Script isn't designed for 4.1.18.
Maybe i made a typo, haven't looked at the script for a long time, the script should abort on 4.1.18.
You could try to update to the latest kernel and then run the installer again as i tested it on 4.9.
I do have a other unpublished script which you could try also.
picotoolkit.zip
(8.35 KiB) Downloaded 65 times

Re: UPS Pico + Domoticz integration | New wiki page

Posted: Sunday 26 November 2017 0:25
by DutchDomoticz
Siewert308SW wrote: Friday 24 November 2017 22:57
DutchDomoticz wrote: Friday 24 November 2017 22:41 Back again,

I have restarted from scratch.
Started with an image file "domoticz-raspberrypi-sdcard-4834.img". This has kernel 4.1.18-v7+ #846.
Used the PIco installer script created by Siewert https://github.com/Siewert308SW/pico_installer.
The install ran successful, but after reboot I got an error message in /etc/rc.local.
After commenting out this line:

Code: Select all

#echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device ( sleep 4; hwclock -s ) &
And adding this line:

Code: Select all

sleep 4;hwclock -s &
Things seemed to be OK and I could successfully see the status of the PIco UPS.
The firmware version of the UPS is 0x18.
When trying to update the UPS firmware using the PIco installer script created by Siewert I get an error message saying "/dev/serial0 not found".

It seems to me like there is an incompatibility between the kernel version and the code in the script which prevents it from communicating with the UPS to do the firmware update.

I would love to hear anybody's thoughts on how to get further.
Ideally I want to update the UPS firmware to 0x38, update the kernel to the latest 4.9 version and finally be able to run domoticz again :)

Regards,
Dick
Script isn't designed for 4.1.18.
Maybe i made a typo, haven't looked at the script for a long time, the script should abort on 4.1.18.
You could try to update to the latest kernel and then run the installer again as i tested it on 4.9.
I do have a other unpublished script which you could try also.

picotoolkit.zip
Hi,

I tried it again several times. Now based on Jessie 4.9. Several times with pico_installer.sh and several times with picotoolkit.sh. Every time I ran into communication issues where the software can't read the status of the PIco UPS. I think the combination of Jessie 4.9 and PIco UPS firmware 0x18 isn't going to work. Maybe if I can get the PIco UPS firmware to a newer version I can make it work. The problem is that I don't know if that is possible in another way then I have tried so far.
Any suggestions?

Regards,
Dick

Re: UPS Pico + Domoticz integration | New wiki page

Posted: Monday 14 May 2018 10:09
by rron
Siewert308SW wrote: Friday 24 November 2017 22:57
DutchDomoticz wrote: Friday 24 November 2017 22:41 Back again,

I have restarted from scratch.
Started with an image file "domoticz-raspberrypi-sdcard-4834.img". This has kernel 4.1.18-v7+ #846.
Used the PIco installer script created by Siewert https://github.com/Siewert308SW/pico_installer.
The install ran successful, but after reboot I got an error message in /etc/rc.local.
After commenting out this line:

Code: Select all

#echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device ( sleep 4; hwclock -s ) &
And adding this line:

Code: Select all

sleep 4;hwclock -s &
Things seemed to be OK and I could successfully see the status of the PIco UPS.
The firmware version of the UPS is 0x18.
When trying to update the UPS firmware using the PIco installer script created by Siewert I get an error message saying "/dev/serial0 not found".

It seems to me like there is an incompatibility between the kernel version and the code in the script which prevents it from communicating with the UPS to do the firmware update.

I would love to hear anybody's thoughts on how to get further.
Ideally I want to update the UPS firmware to 0x38, update the kernel to the latest 4.9 version and finally be able to run domoticz again :)

Regards,
Dick
Script isn't designed for 4.1.18.
Maybe i made a typo, haven't looked at the script for a long time, the script should abort on 4.1.18.
You could try to update to the latest kernel and then run the installer again as i tested it on 4.9.
I do have a other unpublished script which you could try also.

picotoolkit.zip
I'm sorry that came back to this old post but I have some trouble with your script. This is what the output is. I als did a new install but that gave the same output.
The battery status is not ok. I'm still on jessy and I have have Pi 3b.
[*] PIco HV3.0a UPS Toolkit [*]
[*] Version : 2.0 [*]
[*] Updated : 27 Jan 2018 [*]
[*] Created By : Siewert308SW [*]
[*] GitHub : http://bit.ly/2fkTaGz [*]
[*] Dev Thread : http://bit.ly/2hz7vzT [*]

=================================================================================

1) Install - PIco HV3.0A
2) Remove - PIco HV3.0A
3) Status - PIco HV3.0A
4) Quit
#? 3

____ ___ _ ___ _______ ___ _ _ _ ____ ____
| _ \_ _|___ ___ | | | \ \ / /___ / / _ \ / \ | | | | _ \/ ___|
| |_) | |/ __/ _ \ | |_| |\ \ / / |_ \| | | |/ _ \ | | | | |_) \___ \
| __/| | (_| (_) | | _ | \ V / ___) | |_| / ___ \ | |_| | __/ ___) |
|_| |___\___\___/ |_| |_| \_/ |____(_)___/_/ \_\ \___/|_| |____/


.~~. .~~.
'. \ ' ' / .'
: .~.'~'.~. : _____ _ _ ___ _
: .~.'~'.~. : |_ _|__ ___ | | |/ (_) |_
~ ( ) ( ) ~ | |/ _ \ / _ \| | /| | _|
( : '~'.~.'~' : ) | | (_) | (_) | | \| | |_
~ .~ ( ) ~. ~ |_|\___/ \___/|_|_|\_\_|\__|
( : '~' : )
'~ .~~~. ~'
'~'
::: PIco HV3.0a Status
=================================================================================

**********************************************
* UPS PIco HV3.0A Status *
* Version 6.0 *
**********************************************

- PIco Firmware..........: 38
- PIco Bootloader........: 50
- PIco PCB Version.......: 41
- PIco BAT Version.......: LiPO (ASCII: P)
- PIco BAT Runtime.......: 1 MIN
- PIco rs232 State.......: OFF

- Powering Mode..........: RPi POWERED
- Charger State..........: CHARGING
- Battery Percentage.....: -300 %
- Battery Voltage........: 0.7 V
- RPi Voltage............: 5.3 V

- RPi CPU Temperature....: 70.9 C
- NTC1 Temperature.......: 53 C
- TO-92 Temperature......: 11 C

- PIco FAN Mode..........: AUTOMATIC
- PIco FAN Temp Threshold: 35 C

**********************************************
* Powered by PiModules *
**********************************************

=================================================================================

1) Install - PIco HV3.0A
2) Remove - PIco HV3.0A
3) Status - PIco HV3.0A
4) Quit
#?

Re: UPS Pico + Domoticz integration | New wiki page

Posted: Friday 11 January 2019 22:23
by AllesVanZelf
@jfhautenauven
I know this is an old post, but I tried your script in my setup. Thank you.
But it is working partially.
I have an RPi 3B, with UPS PIco HV3.0B and large battery.
I made the dummy switches and edited the python script. But now I get strange values.
- UPS Pico firmware version: 00
- UPS Pico battery voltage: 49V
- UPS Pico RPi voltage: 49.04V
- UPS Pico power source: RpI powered (that's fine I assume).
- UPS Pico battery level: 5700%
- UPS Pico battery temp: 0 (degrees Celsius)

Is it possible to move the comma?
How to fix the battery temp?
How to fix the firmware version? I have firmware EC.
How to fix the battery level to 106%?

Status.py:
***********************************
UPS PIco HV3.0A Status
***********************************

UPS PIco Firmware.....: ec
UPS PIco Bootloader...: 53
UPS PIco PCB Version..: 42
UPS PIco BAT Version..: LiPO (ASCII: S)
UPS PIco BAT Runtime..: TIMER DISABLED
UPS PIco r232 State...: OFF

Powering Mode.........: RPi POWERED
BAT Percentage........: 106.666666667 %
BAT Voltage...........: 4.2 V
RPi Voltage...........: 5.4 V
NTC1 Temperature......: 52 C
TO-92 Temperature.....: 14 C
Extended Voltage......: 0.0 V
A/D2 Voltage..........: 0.0 V