This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

UTM Temps to ioBroker and HabPanel

Hello all,

I am from Germany, but I send this post in english :-)

 

I searched around Google to get a way to get diversend temps from the Sophos UTM (free home) to an iobrooker instance.

I didn´t found something really useful so I did it on myself. Here are the steps:

 

1. Enable SSH in the Sophos UTM (loginuser is enough, but give a password for root too)

2. Login via SSH in your UTM and switch to root via "su" and password
(it seams you can only have one(!) active connecting for each user, so don´t try a "double login" e.g. via SCP and SSH at the same time)

3. type : "sensors" and look if you get any. For my mini PC its Temp1, Core 0 and Core 2

4. Create a sh Script something like the following : (my temps.sh script is in /etc)

#! /bin/bash
cd /etc
var1=$(sensors | grep temp1)
echo ${var1:15:2} > boardtemp.txt
var2=$(sensors | grep 'Core 0')
echo ${var2:15:2} > core0temp.txt
var3=$(sensors | grep 'Core 2')
echo ${var3:15:2} > core2temp.txt
curl -v -T /etc/boardtemp.txt username:password@_of_iobrooker
curl -v -T /etc/core0temp.txt username:password@_of_iobrooker
curl -v -T /etc/core2temp.txt ftp://username:password@_of_iobrooker

5. Save the file and now "vi" a crontab named "crontab.temps"

6. enter something like this : 

* * * * * root /etc/temps.sh

7. Reboot UTM

8. Login via SSH and do a "more crontab"

Look for an entry of your "temps.sh" in crontab .. if the entry is there, check your iobroker ftp upload dir, if 3 oder more files exists:

In my config "boardtemp.txt", "core0temp.txt" and "core2temp.txt"

Check the content of the files. It should be something like "45" thats just the string(!) of the temp of the sensor.

Check the file date / time if it gets updated. If everything is okay, witsch over to "iobroker"

9. Install adapter "Parser"

10. Configure "Parser" like :

Default Poll Intervall : 5000ms

 

Name : baordtemp

URL oder Dateiname: /your_FTP_upload_dir

RegEx : empty

Num : 0

Rolle : temp

Typ : num

Einheit : empty

Alt : not checked

Ersatz : empty

Faktor : 1

Offset : 0

Intervall : empty

and save it

11. Check if "parse.0" under objects gets some data

12. goto Hab Panel

13. Create a custom HabPanel Widget

14: Configuration settings : (that depends on your data obove, so just an example)

Choose Item

ID : fire_boardtemp

Label : Board Temperature

Default value : 0

Description : empty

15: go to Code

Example : (insert)

<font size="5" color="red">Sophos UTM Temps</font><br>
<div align="left"><font size="3">MB Temp&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: {{itemValue(config.fire_boardtemp)}} &***;C<br></font>

16: Save

17: add your new custom widget to the HabPanel

18: assign the sensor to the Widget

19: save and run and you get the temp of your utm updated every 5 secs

Thats a quick and a bit dirty way to get the temps out of your UTM to iobrooker and HabPanel.

 

Have fun.

 

RevMaster



This thread was automatically locked due to age.