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:
I found the regex to be this:
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).
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.
I am learning a lot today.
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.
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”.