Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team
Question
Lambik 192
Hi to you all!
This Virtual device can check values from an UPS connected to a Synology NAS (or even to any NUT-server, didn't check that).
The principle is simple. A Synology uses NUT (
Please login or register to see this link.
) for communicating to an UPS and reporting to other Synology's.With a Virtual Device you can setup a TCP communication on port 3493 and receive variables about the status of the connected device. I made a Virtual Device which you can use and made an icon to go with it.
Preparations
Synology Preparations:
First of all you need to prepare the Synology (the one where the UPS is connected to) to accept the HC2 to communicate:
- Log on In the DSM as admin and go to: Control Panel --> Hardware & Power --> UPS (tab)
- Check 'Enable network UPS server'
- Click on button 'Permitted DiskStations' and add in the pop-up window the IP-address of your HC2. Confirm with the 'OK'-button
- When the pop-up is closed, click on the 'Apply'-button.
Note: If you have Firewall enabled it is not necessary to add the 3493 port.
HC2 preparitions:
- Add three Global Variables called "VD_UPS_Instance" (to block more then one instances of the Virtual Device running and store status of communication), "VD_UPS_Battery_Lev" (for storing battery level) and 'VD_UPS_Battery_RT' (battery runtime in seconds)
- Import the Virtual Device (attached to this posting)
- Change the Virtual Device IP-Address setting to match the IP of your Synology/NUT-server
- Change the Virtual Device Port setting to match the TCP-communicationport of your Synology/NUT-server (should be 3493 in most cases)
Modding:
In the Virtual Device are variables which can be changed to your needs if necessary. If you want another value read from the UPS-server, check
Please login or register to see this link.
for the different commands.You can also use Telnet and use the command
Please login or register to see this code.
You get a list of all variables available which van be used in the Virtual Device bij altering line 11 from the 'Check Battery Level'-button :
Please login or register to see this code.
Also if you want more functions just copy the code to a new VD-button and change the variables of your choice.
The debug Window shows what the VD is doing. If everything is working to your satisfaction, you can disable the debug messages by setting 'false' to the line (4)
Please login or register to see this code.
In the main loop you can find some additional info if needed.
Added:
7 March 2015 V0.3:
- Function to check status every 5 minutes
- Change icon depending battery level
- Batterytime left in seconds
If you suggestions, remarks or questions, don't hesitate to post. If I can I will help. Well, I will give it a try...
Please login or register to see this image.
/emoticons/default_icon_mrgreen.gif" alt=":mrgreen:" />Have Fun!!
Please login or register to see this attachment.
Please login or register to see this attachment.
Please login or register to see this attachment.
Please login or register to see this link.
Link to comment
Share on other sites
16 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.