openhab-cloud icon indicating copy to clipboard operation
openhab-cloud copied to clipboard

Cloud not reporting online/offline alerts

Open rkoshak opened this issue 6 years ago • 27 comments

When an openHAB Cloud connected OH goes offline we used to get an alert on the phone apps. This alert is no longer being sent. Per this thread: https://community.openhab.org/t/myopenhab-org-online-offline-notification/51339 the feature was temporarily turned off and may not have been turned back on.

rkoshak avatar Sep 13 '18 17:09 rkoshak

This affect also me. Is there any plan to re-enable online/offline notifications?

dmachtey avatar Nov 11 '18 14:11 dmachtey

+1 may i provide some help in fixing this issue? I would be interested in helping with this and other issues...

Oeti avatar Dec 11 '18 14:12 Oeti

+1 I also have been missing this feature. Please re-enable it.

peterloron avatar Dec 11 '18 17:12 peterloron

Experienced this issue today. I relied on it because it was always accurate.

I just found out that it isnt working by accident. I am sure that there are others who are not aware about it.

Would be great if you could turn it back on!

By the way: thanks for the great work with openhab!

satheras avatar Dec 16 '18 14:12 satheras

+1

Would also love to have this turned back on, if possible.

ghost avatar Dec 17 '18 20:12 ghost

+1 Would love to see this back in action again.

ddt3 avatar Jan 22 '19 07:01 ddt3

+1 My install of Openhab has gone a bit unstable at the moment and is hanging about once a week. I have got so used to it being rock solid that I am missing these hangs and I did not realise the cloud notifications had been turned off. I too would love to see it reinstated.

hpuk2000 avatar Mar 01 '19 12:03 hpuk2000

+1 Just got late to work because my morning alarm is triggered through a webhook and the myopenhab connection was hung-up (only started working again after a restart of my openhab server, although myopenhab said my server was "online"). It would be awesome if the connection state was monitored on the local openhab instance with a notification or optionally even better a custom rule triggered, once a disconnection is detected. A good home automation system has to be reliable, otherwise things have to be set up redundantly.

fhb avatar Mar 20 '19 10:03 fhb

It was very useful feature, please enable it back

isemenko avatar May 06 '19 11:05 isemenko

+1 please, will help a lot. Thank you

Muplex avatar Jul 12 '19 19:07 Muplex

So? Let’s re enable this please

gnalbandian avatar Oct 30 '19 03:10 gnalbandian

Agree ! It was really useful!

hpuk2000 avatar Oct 30 '19 10:10 hpuk2000

It has been a year since this is open. As there shouldn’t be any development involved, I’m guessing it’s quite quick fix. Thanks in advance.

matushromada avatar Dec 03 '19 07:12 matushromada

+1

broliyoung avatar Jun 26 '20 22:06 broliyoung

+1

PaulHam211 avatar Jul 27 '20 13:07 PaulHam211

+1

99Lazarus99 avatar Aug 16 '20 10:08 99Lazarus99

+1

trainormg avatar Oct 28 '20 23:10 trainormg

@digitaldan Hello, may you please have a look at this?

matushromada avatar Oct 29 '20 07:10 matushromada

Would really like this as well!

fullmoonguru avatar Feb 16 '21 18:02 fullmoonguru

Same please. It would be super helpful to be able to know when my server went offline

alonaviv avatar May 04 '22 15:05 alonaviv

@kaikreuzer Is there any chance we could bring this back?

matushromada avatar May 05 '22 06:05 matushromada

The functionality was removed when we migrated to a multi host architecture some time ago. The original app was designed to run under a single process and the logic to determine offline status did not work when running across multiple servers . It’s not a matter of if we want it or not , but the work required to rewrite this in a way that works now , and keeps our system scalable . It was always on the list of things todo, but i have not come back to it and don’t know when i will.

digitaldan avatar May 05 '22 14:05 digitaldan

@digitaldan

The functionality was removed when we migrated to a multi host architecture some time ago. The original app was designed to run under a single process and the logic to determine offline status did not work when running across multiple servers . It’s not a matter of if we want it or not , but the work required to rewrite this in a way that works now , and keeps our system scalable . It was always on the list of things todo, but i have not come back to it and don’t know when i will.

Thank you for the clarification, as there's development involved, it's also up to the community to help. Anyone with the right skills is welcome to help! (unfortunately, I'm not one of them).

matushromada avatar May 05 '22 17:05 matushromada

+1 This feature would be really-really useful!

attilabalazsy avatar Aug 08 '22 20:08 attilabalazsy

+1 This would be useful. Anyone know of a way to monitor the status at myopenhab.org from the local instance. I monitor that we have internet access etc and change some LED strips if something is wrong. Occasionally it goes offline and I only know when I ask cloud speaker to do something and it complains the device or hub is offline.

bazza1024 avatar Oct 24 '22 19:10 bazza1024

This is how we do it, but it takes another OH controller to do it:

Alert – OH System Down

This rule will send an email if an openHAB system is offline for more than 3 hours.

Required: Tailscale installed on system to be monitored, another OH system to monitor IP addresses with Network Binding and Mail Binding installed, and a group (Item) for the OH systems you want to monitor with the aggregation function set to “All ON then ON else OFF”.

Settings > Things > + > Network Binding > Pingable Network Device > ID = Ping_Customername# > Label = Ping – Customername# > Hostname or IP = ip from Tailscale (without :8080) > Refresh Interval = 300000 > Retry = 6 > Create Thing

Settings > Things > Thing just created > Channels > Online (switch) > Add Link To Item > Create a new Item > Name = Ping_Customername# > Label = Ping – Customername# > Parent Group = OH Systems > Close > Link > Save

Rules > New Rule > ID = Alert_System_Offline > Name = Alert – System Offline

Code > Replace existing code with code below:

configuration: {}
triggers:
  - id: "1"
    configuration:
      cronExpression: 0 0 * * * ? *
    type: timer.GenericCronTrigger
conditions: []
actions:
  - inputs: {}
    id: "2"
    configuration:
      blockSource: <xml xmlns="https://developers.google.com/blockly/xml"><block
        type="oh_log" id="3ntY/cqP4OEGlO7ekWty" x="-2016" y="20"><field
        name="severity">info</field><value name="message"><shadow type="text"
        id="@OcaG9FOaYg;%cr@X4`X"><field name="TEXT">OH System Offline Rule
        Started</field></shadow></value><next><block type="oh_sleep"
        id="#5{IeP^V-RN]`1yA^lfd"><field
        name="milliseconds">5000</field><next><block type="controls_if"
        id="4@U|GA#I9vjU{n3s.~8R"><mutation elseif="1"></mutation><value
        name="IF0"><block type="logic_compare" id="R{MRikkH@)iW/;AFZj[;"><field
        name="OP">EQ</field><value name="A"><block type="oh_getitem_state"
        id="G)zY2,`/ZYvEBN]~{%rM"><value name="itemName"><shadow type="oh_item"
        id="GaA70K1x29}AXBTTI{-{"><field
        name="itemName">OH_Systems</field></shadow></value></block></value><value
        name="B"><block type="text" id="H=Fzh6lL;=|~mCoqAwBd"><field
        name="TEXT">OFF</field></block></value></block></value><statement
        name="DO0"><block type="oh_timer" id="NdTJ2fW$1~t6gvsjW|mp"><field
        name="delayUnits">plusHours</field><value name="delay"><shadow
        type="math_number" id="otI%iP,VT#I=+[%M8=$v"><field
        name="NUM">3</field></shadow></value><value name="timerName"><shadow
        type="text" id="hry6.e7COO#4Yrlw%PNr"><field name="TEXT">OH System
        Offline Timer</field></shadow></value><statement name="timerCode"><block
        type="oh_log" id="{k@Er3wG8e6$n.*+A_g["><field
        name="severity">info</field><value name="message"><shadow type="text"
        id="C`ZX6$9jB.8rJ+#GpmIk"><field name="TEXT">Email Sent - OH System
        Offline</field></shadow></value></block></statement></block></statement><value
        name="IF1"><block type="logic_compare" id="`0xmVOp9Yi!jHAVTY~nr"><field
        name="OP">EQ</field><value name="A"><block type="oh_getitem_state"
        id="gn_P~zcF0r4[%lu*XxNO"><value name="itemName"><shadow type="oh_item"
        id="rB6;`FJ6$r67tZ2u0Y|0"><field
        name="itemName">OH_Systems</field></shadow></value></block></value><value
        name="B"><block type="text" id="Vv,,Sxe#prf8)FVHzium"><field
        name="TEXT">ON</field></block></value></block></value><statement
        name="DO1"><block type="oh_timer_cancel"
        id="o(tjF3t^a{zsOe8!gwom"><value name="timerName"><shadow type="text"
        id="N?I[ze3evs@))+@xy@h{"><field name="TEXT">OH System Offline
        Timer</field></shadow></value></block></statement></block></next></block></next></block></xml>
      type: application/javascript
      script: >
        var logger =
        Java.type('org.slf4j.LoggerFactory').getLogger('org.openhab.rule.' +
        ctx.ruleUID);


        var thread = Java.type('java.lang.Thread')


        var scriptExecution = Java.type('org.openhab.core.model.script.actions.ScriptExecution');


        var zdt = Java.type('java.time.ZonedDateTime');


        if (typeof this.timers === 'undefined') {
          this.timers = [];
        }



        logger.info('OH System Offline Rule Started');

        var Actions = Java.type("org.openhab.core.model.script.actions.Things");

        var mailActions = Actions.getActions("mail","mail:smtp:SMTP_Server");

        mailActions.sendMail("[email protected]", "Alert – openHAB System Offline", "An openHAB system has gone offline. Please check Tailscale to identify offline system.");


        thread.sleep(5000);

        if (itemRegistry.getItem('OH_Systems').getState() == 'OFF') {
          if (typeof this.timers['OH System Offline Timer'] === 'undefined' || this.timers['OH System Offline Timer'].hasTerminated()) {
            this.timers['OH System Offline Timer'] = scriptExecution.createTimer(zdt.now().plusHours(3), function () {
              logger.info('Email Sent - OH System Offline');
              })
          }
        } else if (itemRegistry.getItem('OH_Systems').getState() == 'ON') {
          if (typeof this.timers['OH System Offline Timer'] !== 'undefined') {
            this.timers['OH System Offline Timer'].cancel();
            this.timers['OH System Offline Timer'] = undefined;
          }
        }
    type: script.ScriptAction

Save > Save

fullmoonguru avatar Oct 25 '22 12:10 fullmoonguru

A lot of requests in several years on these topic. In my opinion it is an integration that really missing... sometime know that OH local system is down will save you time and money because you could know it in short time and check the possible critical devices that is not controlled by OH anymore (in my case one big criticity is the termoregulation of a single room.... if the heating fan (0.8 KW/h) switch on because room temperature is low and than OH disconnect after a while, there is the possibility that the hating fan still ON for hours even if the role setpoint to switch it of is overtaken.... If i could know the system is not responsive anymore I will check the situation immediatelly).

I there in your opinion a possibility to implement somenting in the year 2024 on the next OH4 release ?

Muplex avatar Nov 30 '23 12:11 Muplex