Newbie here - how to integrate with existing ecosystem

Excellent. Im reformatting it the same way to insert it to Influx for Grafana. So ill just publish the same structure in the emon/dds238 topic.

1 Like

Not using Z is important. Python in particular does not convert a time with Z to 00:00, it just treats it as local. Without a TZ, emoncms (PHP in this case) will treat as local - personally I make sure I either use a UTC Timestamp (an integer) or add the right offset in +00:00 format

im using python’s arrow lib:
arrow.get(data["Time"]).format('YYYY-MM-DDTHH:mm:ssZZ')
which gives me:

‘2022-11-03T16:27:46+00:00’

Yes but if the original time had a Z in it (implying UTC) Python will convert that as a local time not a UTC time.

Just convert it to an integer for absolute safety!

Missed that bit, I’m referring to the standard Library.

How do you measure the temperature of a pipe? I want to stick the sensors so i can measure both the outgoing and returning hot water. However just sticking the DS sensor on the surface is not very accurate.

I am failing at the install process. I have my own MariaDB server so i changed the hostname to point to it but still fails. User+db+password are already created:

-------------------------------------------------------------
Install Emoncms Core Modules
-------------------------------------------------------------
- Module dashboard already exists
- Module device already exists
- Module app already exists
- Module graph already exists
- Module postprocess already exists
- Module demandshaper already exists
- Module backup already exists
- Module sync already exists
- Module usefulscripts already exists
Update Emoncms database
PHP Fatal error:  Uncaught mysqli_sql_exception: Connection refused in /opt/openenergymonitor/EmonScripts/common/emoncmsdbupdate.php:16
Stack trace:
#0 /opt/openenergymonitor/EmonScripts/common/emoncmsdbupdate.php(16): mysqli->__construct()
#1 {main}
  thrown in /opt/openenergymonitor/EmonScripts/common/emoncmsdbupdate.php on line 16

Fatal error: Uncaught mysqli_sql_exception: Connection refused in /opt/openenergymonitor/EmonScripts/common/emoncmsdbupdate.php:16
Stack trace:
#0 /opt/openenergymonitor/EmonScripts/common/emoncmsdbupdate.php(16): mysqli->__construct()
#1 {main}
  thrown in /opt/openenergymonitor/EmonScripts/common/emoncmsdbupdate.php on line 16

EDIT: fixed the connection issue

I think I remember people being told to stick them on with heat conducting paste, then wrap in foil, then put insulation over it all. It’s better if your pipe work has sensor pockets in it (mine does) but stuck on can work OK.

2 Likes

Mine doesnt. I can read it from the heatpump itself be need to invest time to read its Modbus interface.

I have another problem with the CMS. Registered a user but receive an error when trying to login:


Warning: scandir(/home/pi/demandshaper/devices): failed to open dir: No such file or directory in /opt/emoncms/modules/demandshaper/demandshaper-module/demandshaper_model.php on line 58

Warning: scandir(): (errno 2): No such file or directory in /opt/emoncms/modules/demandshaper/demandshaper-module/demandshaper_model.php on line 58

Warning: count(): Parameter must be an array or an object that implements Countable in /opt/emoncms/modules/demandshaper/demandshaper-module/demandshaper_model.php on line 59

Fatal error: Uncaught Error: Call to a member function get() on bool in /opt/emoncms/modules/demandshaper/demandshaper-module/demandshaper_model.php:111 Stack trace: #0 /opt/emoncms/modules/demandshaper/demandshaper-module/demandshaper_menu.php(15): DemandShaper->get_list() #1 /var/www/emoncms/core.php(282): require('/opt/emoncms/mo...') #2 /var/www/emoncms/index.php(369): load_menu() #3 {main} thrown in /opt/emoncms/modules/demandshaper/demandshaper-module/demandshaper_model.php on line 111

Im wondering why it scans the /home/pi directory.

EDIT: i had to manually edit the directories in /var/www/emoncms/Lib/process_old_settings.php. Now i have another error :slight_smile:

Fatal error: Uncaught Error: Call to a member function get() on bool in /opt/emoncms/modules/demandshaper/demandshaper-module/demandshaper_model.php:111 
Stack trace: #0 /opt/emoncms/modules/demandshaper/demandshaper-module/demandshaper_menu.php(15): DemandShaper->get_list() 
#1 /var/www/emoncms/core.php(282): require('/opt/emoncms/mo...') 
#2 /var/www/emoncms/index.php(369): load_menu() 
#3 {main} thrown in /opt/emoncms/modules/demandshaper/demandshaper-module/demandshaper_model.php on line 111

Remind me again how you ended up installing this?

I think you are using an external MariaDB? Why - absolutely minimal resources required for it (it just stores the meta data) - actual sensor data is in a flat file system.

KISS - Keep It Simple

I dont know, just followed the EmonCMS Install Scripts. The mysql was enabled by default i just changed the host to use external DB. ECMS is now using the DB without problems but failing somewhere in the PHP modules loading.

I suspect it is failing as it uses the DB for authentication. You are probably the first person to use an external DB. You will just have to debug it :frowning:

I actually manually updated the email_verified verification flag in the DB to 1 because it didnt send me an email when i first registered. But there is another field verification_key which is empty.

EDIT: The scripts are trying to create the tables like groupid int(11) DEFAULT '' which is empty string in an integer field. Mysql complained so i created them as DEFAULT NULL. Now i dropped and recreated them as DEFAULT 0 so no more crashes.

But still cant login. Just nothing happens except a ‘false’ text under the login fields. In the emoncms logs there is only this line:

2022-11-07 15:35:59.011|ERROR|index.php|Not Authenticated|feed/list