i´m using OH 4.0.1 on Ubuntu.
I need the “power export” value from my solar energy inverter to set the maximum charge power to the wallbox. A first test looks fine:
rule "Set max. power charge from PV" when Item Sungrow_WR_Modbus_Export_Power received update then logInfo("RULE",Sungrow_WR_Modbus_Export_Power.state.toString) end
2023-08-16 16:22:49.419 [INFO ] [org.openhab.core.model.script.RULE ] - 4861 W 2023-08-16 16:22:54.685 [INFO ] [org.openhab.core.model.script.RULE ] - 4859 W 2023-08-16 16:23:00.003 [INFO ] [org.openhab.core.model.script.RULE ] - 4819 W
I don´t know how to convert i.e. “4819 W” to a integer value. I´ve tried different ways (replace, parse::integer, …). All ends with errors.
Does anyone have an idea for this?