Hello;
I am looking to display Fahrenheit on my Emoncms. Is there a simple guide out there? I did a search
and the topic has been brought up but did not see a step by step guide. Any help would be appreciated
Thank you
Hello;
I am looking to display Fahrenheit on my Emoncms. Is there a simple guide out there? I did a search
and the topic has been brought up but did not see a step by step guide. Any help would be appreciated
Thank you
On the inputs page, include a process to do the conversion before you log the data.
I tried that and it is not showing up in Fahrenheit. Looking for a guide, do you know if one exists Thank you
What do you mean by
The maths is not converting the number, or it does not show the correct units?
The first is easy. The first two operations in the chain on the Inputs page should be
× 1.8
+ 32
then whatever other processing you already have.
(Note: NOT × input, etc)
For the second, you need to specifically state the units °F in the appropriate place.
Although I was brought up on °F, pounds and ounces, pints and gallons, most things now use metric units, which is probably why there isn’t a built-in conversion.
It is in the Edit Feed dialog @rpenalis.
Sorry, how do I convert my emoncms displays to Fahrenheit?
I don’t the ‘Edit feed’ pull down menu - where is that?
And if I can convert the display, does this only affect the display, or is the it alter the stored source data?
Changing the values displayed, without changing the underlying data can, as far I’m aware, only be done by customising the code inside emonCMS.
If you process the input (the most obvious and easy way), then the data stored from that point onwards will be changed. You can use the post-processor to change data that has already been recorded in a Feed.
If you have historic data that you wish to preserve in a converted form, then I’d suggest you first experiment with converting the incoming data to degrees Fahrenheit and record the values in a new Feed by way of a test. When you’re happy with this, use the post-process module to do the maths on the existing Feed (deg C) and write to a new (deg F) Feed, then switch the input process to send the incoming converted (deg F) values to the new Feed. But first, backup all your data in case of a mistake or confusion.
In Setup, choose Backup and on the Export tab, click Backup. This will make files still on your SD card which you can download when it’s finished, if you wish. You’ll get a link to click to download the files and I’d strongly advise you do.
Still in Setup, go to Inputs and click the spanner icon on the line for the Temperature you want to convert. Choose ‘Reset to original’ and Add the step. (This ensures all the process steps you have and the existing Feed is preserved.) Add another step × and enter the value 1.8 and Add the step. Add another step + and enter the value 32 and Add the step. Add another step Log to Feed and call it something sensible (‘Temp °F’ maybe) and choose ‘Emoncms fixed interval’ and choose a value ideally the same as the existing Feed but certainly longer than the time between incoming values. (This will be a temporary Feed to test with.) Save the changes.
I’ve never used the post-process module, so you must experiment using the instructions I linked above. If I have time later today, I’ll give it a try and update this.
If you do try this yourself, you’ll create another new Feed to store the converted values, but with exactly the same Feed Interval as the original. If all is satisfactory, change the Feed in the Inputs process to be this one, and the newly arriving data should continue to be recorded in this Feed.
I’ve now tried the post-process module. I couldn’t get it to accept the formula (‘Basic formula’), but I did succeed in 2 steps using a temporary feed. Here’s a screenshot of the result after both steps:
This ‘final’ step has all the data to the time step 1 started. I then had to route the Input to this feed (with the maths) in order to collect the ongoing data. I didn’t need to ‘reset to original’ - it’s there for completeness in case there’s a preceding step which changed the value passed down the page.
I could now delete the temporary feed ‘Garage_x18’. It’s dormant - won’t ever be used again. And - if I didn’t want to keep the temperature in degrees Celsius, I could remove the processing for the original feed (step 1 in the screenshot) and delete the feed too.
And to clarify: Changing the units displayed against a value does exactly that - it does nothing to the numbers.
Testing for @Glen_Garfunkel, no matter which variation of f46*1.8+32
I tried, I could not get it to accept the formula, always getting Error: could not understand your formula SORRY....
Eventually, and only a while after I’d written up the procedure and published it, I got it to accept 32+1.8*f46
.
So what are the (undocumented?) restrictions on what it can accept? Why can’t it accept the usual way this formula is written?
Or is it a case of the error message is simply wrong? It surely doesn’t help much.
If you are running emoncms locally, could you use a virtual feed to do the conversion?
That’s something else that’s, shall we say, not all that well documented.
@alexandrecuer any idea how it might be possible to cater for the order that @Robert.Wall mentioned?
The main point is, if the order of operations is super-critical, it MUST be documented. Clearly, by far the best solution is to have no restrictions on the form the formula takes.
@Robert.Wall @TrystanLea : Indeed, it is not documented, really sorry for that, and the behaviour is really weird, cause it is based on regular expressions…
This is initially what I thought to be a basic formula object
So you can do 2*f12
but not f12/2
alone, but you can do 0.5*f12
But you can do f32 + f12/2
of course I can add this in a PR so you have it in the UI but is it clear enough ?
and also I can try to adapt the regular expression so that it can have less restrictions
I’ve done this quite a long time ago (2019 : [A process to manipulate feeds through arithmetic operation by alexandrecuer · Pull Request #8 · emoncms/postprocess · GitHub])
Some time after I’ve introduced the possibility to use the max function and brackets around
objects which are valid basic formula(s), cf that commit
[basic formula improvments by alexandrecuer · Pull Request #19 · emoncms/postprocess · GitHub]
NOTE 1 : when I developed this tool, you could not edit processes, now you can and I had not this in mind with my original design. so you may have also weird behaviour when editing (duplicates datas in the future for example, when running a basic formula a second time with the from the start
option)
NOTE 2 : Now I use python and the PyFina lib to manipule FINA timeseries, and it is really more versatile because it relies on numpy, which is maintained by a strong community of devs…
Many thanks for this, however I’m not sure I understand the diagram.
When you wrote:
is this using:
plus
plus
Therefore, with regard to what is inside the medium blue block itself, either
and
must be present;
and the medium blue block itself can appear zero or as many times as necessary.
I don’t understand this either: If the formula produces a number which is written to a new feed, then is it not indistinguishable from any value in any feed? So why might it show weird behaviour?
[Links to Github don’t help me, I don’t understand it.]
yes exactly, that’s correct. regular expressions work like that. they search for patterns. some are mandatory, other not. It is not so pretty to read but better than many many if else (and more elegant but i understand users dont care about code elegance but I do). not 100% sure, but something can be done to have a less restrictions because indeed doing f12/2 makes really a lot of sense…
this is just something i’ve noticed yesterday when testing postprocess while writing the answer. Must be a bug.
blue feed = original feed
orange = -1 * original feed created by postprocess with the from the start option
the blue feed kept recording and so that’s why there is more data
then i went to the postprocess module, pressed run and got this
so there is a pb…why ? i dont know yet
submitted a PR so that f12/2
can be done
made basic testing. further testing would be appreciated, when PR will be merged to master
behaviour should be conform to this
Changing the values displayed, without changing the underlying data can be done with a virtual feed.
Add a virtual feed, with the original source feed in ºC, apply math and use the virtual feed in ºF where needed.
All done through the UI.
@Robert.Wall : should be OK now. if you choose the master branch of postprocess in your admin components view, you should be able to test the corrected behaviour of basic formula in postprocess. Thanks for feedback
Thank you for this. I shall try to figure out the inner workings of emonCMS to do some tests.
It is looking good. I tried
I think this is a great improvement, thank you.
@TrystanLea Can this be incorporated and documented please?