Change the setpoint value base on a CRON time

  • Platform information:
    • Hardware: RPI3B
    • OS: OPENHABIAN
    • openHAB version: openHAB 2.5.10-1
  • Issue of the topic:

Hello,

Please let me know how If It’s possible to change all the setpoint that are included in a group to a predefine value?

I need to set the temperature value each morning to 21C.

My Items:
Group gSetPoint
Number SetPointContainer “Temperatura dorita: [%.1f °C]” (gSetPoint) // Birou Mircea
Number SetPointHala “Temperatura dorita: [%.1f °C]” (gSetPoint) // Sufragerie
Number SetPointAngelescu “Temperatura dorita: [%.1f °C]” (gSetPoint) // Birou Angelescu
Number SetPointFerolli “Temperatura dorita: [%.1f °C]” (gSetPoint) // Birou Ferolli
Number SetPointBirouri “Temperatura dorita: [%.1f °C]” (gSetPoint) // Zona Birouri

So my rule should begin with:
rule “All_Setpoints_to_21”
when Time cron “0 0 6 ? * MON-FRI *”
then

end

Thank you in advance!

sendCommand to a Group will forward the command to all the members of the Group, but only if the Group is given a type.

Group:Number gSetPoint

Thank you @rlkoshak for your prompt answer!
Unfortunately something it’s still not working right. The values of setpoint are not updated in sitemap. A refresh page it’s needed, after the values of the setpoint are updated:
My configuration is now:
Items:
Group:Number gSetPoint

Number SetPointContainer “Temperatura dorita: [%.1f °C]” (gSetPoint) // Birou Mircea
Number SetPointHala “Temperatura dorita: [%.1f °C]” (gSetPoint) // Sufragerie
Number SetPointAngelescu “Temperatura dorita: [%.1f °C]” (gSetPoint) // Birou Angelescu
Number SetPointFerolli “Temperatura dorita: [%.1f °C]” (gSetPoint) // Birou Ferolli
Number SetPointBirouri “Temperatura dorita: [%.1f °C]” (gSetPoint) // Zona Birouri

Rule:
rule “WeekDays Temp to 18”
when Item tst changed from OFF to ON //Time cron “0 0 6 ? * MON-FRI *”
then
gSetPoint.sendCommand(18)
logInfo(“info”,“all setpoint to 18”)
end
sitemap:
sitemap hvac label=“Incalzire”
{
Frame label=“test” {
Switch item=tst
}
Frame label=“Birou Mircea” visibility=[Modul_Ales==2]{
Text item=ShellyHT_Mircea_Temp label=“Temperatura Actuala”
Setpoint item=SetPointContainer step=0.5 minValue=15 maxValue=27
Text item=StareIncalzireContainer valuecolor=[==“ON”=“red”,==“OFF”=“blue”]
}

Logview Messages:

2021-02-23 18:43:32.631 [ome.event.ItemCommandEvent] - Item 'tst' received command ON

2021-02-23 18:43:32.644 [vent.ItemStateChangedEvent] - tst changed from OFF to ON

==> /var/log/openhab2/openhab.log <==

2021-02-23 18:43:38.748 [INFO ] [.eclipse.smarthome.model.script.info] - all setpoint to 21

==> /var/log/openhab2/events.log <==

2021-02-23 18:43:38.759 [ome.event.ItemCommandEvent] - Item 'gSetPoint' received command 18

2021-02-23 18:43:38.769 [ome.event.ItemCommandEvent] - Item 'SetPointContainer' received command 18

2021-02-23 18:43:38.776 [ome.event.ItemCommandEvent] - Item 'SetPointHala' received command 18

2021-02-23 18:43:38.787 [ome.event.ItemCommandEvent] - Item 'SetPointAngelescu' received command 18

2021-02-23 18:43:38.792 [ome.event.ItemCommandEvent] - Item 'SetPointFerolli' received command 18

2021-02-23 18:43:38.798 [ome.event.ItemCommandEvent] - Item 'SetPointBirouri' received command 18

2021-02-23 18:43:38.824 [GroupItemStateChangedEvent] - gSetPoint changed from 18 to UNDEF through SetPointContainer

2021-02-23 18:43:38.829 [vent.ItemStateChangedEvent] - SetPointHala changed from 21 to 18

2021-02-23 18:43:38.834 [vent.ItemStateChangedEvent] - SetPointAngelescu changed from 21 to 18

2021-02-23 18:43:38.838 [vent.ItemStateChangedEvent] - SetPointFerolli changed from 21 to 18

2021-02-23 18:43:38.842 [vent.ItemStateChangedEvent] - SetPointBirouri changed from 21 to 18

2021-02-23 18:43:38.855 [GroupItemStateChangedEvent] - gSetPoint changed from UNDEF to 18 through SetPointBirouri

2021-02-23 18:43:38.862 [ome.event.ItemCommandEvent] - Item 'LED3_Hala' received command OFF

2021-02-23 18:43:38.875 [ome.event.ItemCommandEvent] - Item 'LED2_Angelescu' received command OFF

2021-02-23 18:43:38.899 [vent.ItemStateChangedEvent] - StareIncalzireHala changed from ON to OFF

2021-02-23 18:43:38.912 [vent.ItemStateChangedEvent] - LED3_Hala changed from ON to OFF

2021-02-23 18:43:38.930 [ome.event.ItemCommandEvent] - Item 'LED4_Ferolli' received command OFF

2021-02-23 18:43:38.943 [ome.event.ItemCommandEvent] - Item 'LED5_Birouri' received command OFF

2021-02-23 18:43:38.956 [ome.event.ItemCommandEvent] - Item 'LED6_Main' received command OFF

2021-02-23 18:43:38.964 [vent.ItemStateChangedEvent] - LED6_Main changed from ON to OFF

That’s an issue with the sitemap and perhaps an issue needs to be filed. All you have control over is updating and commanding Items. If the sitemap doesn’t show those changes there really isn’t anything you can do about it from your config or rules.

Ok! Thank you for your support!

Sitemap name must match filename for refreshing e.g. hvac.sitemap

Thank you for your response. The name was fine. In the end I reboot the system and now the sitemap is working fine…