Hi,
I am not able to get the gas value out of my “slimmemeter”
Tried al kinds of settings, different mbus etc.
The raw data however is available, and looks like this:
(211230120000)(00)(60)(1)(0-1:24.2.1)(m3)(14958.845)
I found the regex to be this:
/.(m3)((.))/gm
Now all I need is a template in HA that creates the right sensor.
Yes, I agree with you, but like you said it’s ‘greedy’ so it matches anything including a non-numeric string. Perhaps the data will never contain anything other than a float value but, just to be extra careful, the suggested regex pattern looks exclusively for a numeric string (with or without a decimal point).
As a quick experiment, try this version and see if it produces the same error. It uses double-quotes inside the template and single-quotes outside the template:
Because you are using the legacy method of configuring a Template Sensor; it doesn’t directly support the state_class option (only indirectly when included via customization). If you change the Template Sensor’s configuration to the “modern” format, state_class is a valid option.
O boy,
I am learning a lot today.
Thanks again.
The sensor seems to work fine on my energy dashboard. data is coming in.
I would like a bar on my regular dashboard as wel, that shows the gas in m3 for that day.
A bit like the original energy dashboard.
So I would need to do some math on the sensor? or is there an easy way?
The sensor should already be in HA, because the energy dashboard is using it, or creating it. but I can’t find it.
Any clue?
Glad to hear that the original problem has been solved.
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been solved. It will also place a link below your first post that leads to the Solution post. All of this helps users find answers to similar questions. For more information, please refer to guideline 21 in the FAQ.
It would be best to ask this question in a separate topic where it will be read by a wider audience. This topic draws the attention of people interested in employing “Regex to filter raw data”.
Hi, thanks for this topic it made a lot of things clear to me!
But unfortunately it still don’t work for me… The sensor says its no available. Maybe I forgot something?