Hi,
It seems that my Fronius solar roof can only trigger an action if I don’t define any dimension for the item.
Can anybody confirm that?
I’m using the experimental rules because I can’t program enough.
I have a rule that checks how much power my solar roof is putting into the grid. I’m using the PowerGrid item for that. As long as I had defined that item with the “Power” dimension it didn’t work. Since I removed the dimension definition it now works.
im actually triying to create my first rule ever and is about fronius. Could you please share the code of your rule here? Im triying to understand as much as I can with examples.
here is my thread im triying to turn on AC machines depending on the solar production.
Hi @Andreu_Ferret,
I’m not coding the rules but using the experimental rule engine instead.
Here’s what I’m doing:
I’m using as a trigger the update of the PowerGrid item of my Fronius inverter. This updates every 10 seconds.
As an action I defined that my Tesla should start charging (in your case it would be your AC).
But I only want the Tesla to start charging if there’s enough power produced by my solar roof and available to be used for charging. I configured my Tesla to charge with 5A which means it will need at least 3450 W power. Therefore I’m including an additional condition (“but only if”) which checks that the PowerGrid item is less than 3500 W - which means that it’s putting more than 3500 W into the grid.
Well that rule I posted should be easy to understand and edit to your needs.
I created a helper items eg for gridfeed and consumption to have more easy items without that - and + that fronius delivers.
I just read everything with http and Json.
Can share all item definitions if needed.
I’m not sure that the GUI rule thingy actually handles UoM Items. It is not fully developed, nor likely to be anytime soon. You probably want to adopt another framework before you get much further.
Well, it does what I want it to do. And I didn’t find any better framework for me just yet. Again, I’m not enough of a developer to go with coded rules.
But if you have any better suggestions, I’m more than happy to look into it.
yes - however it looks like you are trying to achieve something very similar and could also just use a text rule.
something like this: (however if you want the tesla to be charged manually you would need to add a little more logic. this example rule will turn it off in any case when you consume energy from the grid.)
rule "Tesla laden"
when
Item YOURITEMWITHHEREFORGRIDFEED changed
then
if (YOURITEMWITHHEREFORGRIDFEED.state<-3500) { // Einspeisung ueber 3500 Watt
sendCommand(TESLACHARTGEITEMHERE, ON)
logInfo("Tesla", "Tesla lädt")
}
else if (YOURITEMWITHHEREFORGRIDFEED.state>0 && TESLACHARTGEITEMHERE.state == "ON") { // Es wird Strom vom Netz bezogen und der Tesla lädt gerade
logInfo("Tesla", "Netzbezug während Ladevorgang")
sendCommand(TESLACHARTGEITEMHERE, OFF)
}
end
I created the rule thanks to the example that @shorty707 gave me, however Ill try today to do it on the Experimental rule.
In case it helps you, here is my code. What I do is checking the Fronius production every 60 seconds from 9:00H to 19:00H If the production is lower than 1500w the AC machine will turn OFF if not will turn ON.
rule "kitchen"
when
Time cron "0 0/1 9-19 ? * * *" or
Item fronius_powerinverter_***_inverterdatachannelpac changed
then
if (fronius_powerinverter_***_inverterdatachannelpac.state>1500 && GF_Kitchen_AirCon.state == OFF ) { // AC Powery is > 1500 watts but AC Kitchen is OFF
GF_Kitchen_AirCon.sendCommand(ON) // turn ON AC kitchen
}
else if (fronius_powerinverter_***_inverterdatachannelpac.state<1500 && GF_Kitchen_AirCon.state == ON ) { // AC Powery is < 1500 watts turn OFF AC Kitchen if its ON
GF_Kitchen_AirCon.sendCommand(OFF) // turn OFF AC kitchen
}
end
I hope it helps, and if anybody see any mistake or improve in the rule please let me know
@Andreu_Ferret I didn’t try your rule because mine is working fine since I left the metric definition empty.
What exactly do you mean with your rule doesn’t stop?
I implemented my rules in a way that they act independently from each other:
I have one rule that checks if enough energy is put into the grid. If that’s the case it triggers another rule that starts the charging of the car.