EmonCMS and EmonTx3 v1.1 simulator ready for download

I think I am ready to release the Simulator as a BETA for you to test drive…

you can download it for free here http://79.174.152.130/wordpress/downloads/

or attached: EmonTx3 v1.1.zip (593.4 KB)

Description is on the download page…

Update: version 1.1 now released

2 Solar PV setups and one room temperature sensor, one outdoor temperature sensor.

Version log:

v1.1 Added Sunrise and sunset time for Solar PV, addeed Outdoor temperature based on min max temp (all can be altered in the setup.ini file).

v1.0 First release

Happy simulating
Henrik

1 Like

Fantastic! I’ve just tested, I’m running it via Wine on Ubuntu Linux. Seems work well to post to emoncms.org. However I don’t seem to be able to get “Temp 1” node to work. It’s only posting node “2” not node “20”.

Hi Glyn

the 20 is the temperature setpoint
not the node… is is supposed to simulate an emonTx (reduced) to only 2 PVs and one room temp.
I can make more if it is in demand by the community/users of my program…

“Norm temp 20” is the setpoint
“random 1” is 1/10 of a degree to create some “noise” on the measurement
“diff 2” is the amount a degrees the sinus wave will cover from the Norm temp
"Frequency 1"is how many cycle the sinus wave will make in 1 hour

For Power1 and Power2
Random 25 is the amount of watts the output will fluctuate from the norm Power. again to create some noise

I am working on some cloud prediction to get a more “real” look of the PV output…
and a outdoor temp. bases on historical data min. max temp, sunrise and sunset… that could also be implemented in the POWER 1 og POWER 2 output…

Henrik

Ah got it, sorry I that it said “node temp”! I understand now, seems to be working fine. Nice work.

Good to know it works ok via Wine on Linux.

1 Like

I will try to make a manual in the near future…

Right now I’m trying to make it more realistic. At the moment, all days in a week look almost alike.

Next module I think would be a household power comsumption simulator… with timed on/off of the washing machine, oven, lights etc…

1 Like

Updated the EmonTx3 Simulator
-use sunrise and sunset time in calculation
-Made some sun randomness

The image show a real Solar PV vs a simulated…

Very neat project. When doing bulk loads of data between arbitrary timestamps, which API format are you using to send to the emoncms input endpoint? I’ve been fiddling a bit with the absolute timestamp method, but wondering which you’ve found best. Any chance you’ll post the code to GitHub?

I use Unix timestamp.

Sure I could post the code on github, but I don’t think it will make much sense because it is written in winbatch code and I don’t think many people use this programming platform…

and I dont know how to post to github, I know how to find and use stuff…

emonTx.txt (29.4 KB)

See the “Best way to guarantee times when using BULK load with PHPTIMESERIES?” thread, the absolute timestamp is the only way to avoid the network connection time skewing the timestamp, although I prefer using time=0 and a full timestamp in each packet of the bulk upload.

This project is supposed to be an off-line simulation, with a All in ine Web-server, there is no Linux/ file structure so I will have to rewrite some code to the original EmonCMS to make that work and I don’t want to do that…I want to keep the EmonCMS as a original source code, otherwise the update procedure will be a nightmare to maintain.

You can only use SQL as the engine when creating feeds…

It is of course Henrik’s project and his decision, but I would suggest that he keeps it as he originally intended - as an aid to understanding and programming emonCMS. Whether the data you use for that is real, or whether it is synthesised, should make little difference. In fact, it is probably much better to have well-behaved synthetic data than anomalous real data that might confuse the student.

My reply above was solely in response to @davidski’s question to you, about the api timestamps, nobody has suggested you make any changes, although I have to say I wasn’t aware til now that this did not use the emoncms API so I can understand where David’s question came from.

the simulator makes at http request

http://localhost:8080//input/post.json?node=%node%&json={Power1:%value1%,Power2:%value2%,Temp1:%Value3%}&apikey=%apikey%&time=%unixTime1%"

where all the static and calculated variables are within the two %% signs

and I live in Denmark my timezone is +2 GMT so i have the subtract 2x3600 seconds from the unix time stamp to display the right sunrise and sunset time on the graphs…

I think it looks better to have some random values then a perfect sinus curve. but that is just my opinion…

It would be better to have it all made in php/java whatever so it could be bundled with EmonCMS and the web server… it would also make it OS independent. But my php programming skills are just to pure… so it would take forever to make it work. Winbath is my goto program as I have been using it for more the 15 years… sadly not to much lately do to EmonTx3, emonCMS and Heatpump monitor in the real world…

That doesn’t sound right to me, unixtime is UTC no matter what timezone you are in and that should be how the data is passed to emoncms and how it is stored, all in unixtime, only when viewing/querying the data should it get adjusted to the local TZ and “look right”, providing the TZ is set correctly on emoncms server and the on the PC from which you are browsing (one and the same here).

yes I know unix time = UTC, but if I don’t do the offset, the grapf will be off by 2 hours… guess it can be fixed in the webserver…

The data must be persisted in UTC or you could have problems, eg at the start and end of summer you will have a 1hr hole or a 1hr overlap.

found the settings in the php ini file, now it is all synchronized unix time::slight_smile:

It works, all is syncronized

Version 1.1 now ready for download.

This is a EmonTx3 simulator, with 2 Solar PV setups and one room temperature sensor, one outdoor temperature sensor.

Version log:

v1.1 Added Sunrise and sunset time for Solar PV, adde Outdoor temperature based on min max temp (all can be altered in the setup.ini file).

v1.0 First release

1 Like