Closed frsantos closed 3 months ago
Is there any way of adding complex operations in a custom sensor, apart from addition and subtraction, like the template above?
Not yet. Would be awesome though! At first I used 'eval' with defined equations and parameters but it has serious security implications so I decided to go the hard way which means that it's not really that flexible. :-/ ...yet!
Is there any way of adding complex operations in a custom sensor, apart from addition and subtraction, like the template above?
Not yet. Would be awesome though! At first I used 'eval' with defined equatins and parameters but it has serious security implications so I decided to go the hard way which means that it's not really that flexible. :-/ ...yet!
Not sure how templates are implemented in HA, but could we use the same jinja2 templates as in a helper? I suppose templating in HA is already considering all security implications.
Yes I was looking into utilizations of Template Sensors directly in the integration and would love to do it that way but I'm not yet well educated in that area and not sure how it's supposed to be done. :-/ ...yet!
Add there min_span: 55 into default section. 😉
I have been testing the KStar Hybrid inverter for some days now, and it works perfect. In this PR I update the KStar Hybrid definition file to the new format:
requests
to allow for automatic pollingPV Power
as the sum ofPV1 Power
andPV2 Power
I have a question regarding custom sensors, though: the KStar inverter has the versions stored in single registers as numbers, and to get a readable value, I need to perform some mathematical operations on it:
ARM Version Number
andDSP Version Number
are a single register each, containing the "Version Number" on the first byte and the "Testing version number" on the second byte. The modbus documentation says "10 refer to V1.0", and a note "the test version number range is 0-99. If the DSP1 version number is v1.0, the DSP1 test version number is 2, and the DSP1 full version number is v1.0.2".I came up with a helper to calculate the version from the number in the register, with the following template:
So, the number
5899
gives the versionV2.3.11
.Is there any way of adding complex operations in a custom sensor, apart from addition and subtraction, like the template above?