ChipChop Support Forum
Log in
Log out
Join the forum
My Details
REPLIES: 4
VIEWS: 128
BACK
REPLY TO THIS POST
haruto
29 Dec 2025
I want to send a notification just once.
Hello, this is Haruto. I'm using Google Translate again, so the text may be difficult to read. I understand how to send notifications using the ACTION function, but I keep getting notifications. I would appreciate it if you could tell me how to send a notification only once when the sensor value falls below 20%, and then not send any more notifications even if the sensor value falls below 20% within the next hour. I know you're busy, but I would appreciate your help.
Gizmo
29 Dec 2025

Hi Haruto,

No problems, there are many ways how you can do that so I will give you one example.

I don't know if you need to be able to change 20% limit through Actions or is it something you can hardcode on the device?

This example is if you can hardcode the 20% limit on the device

1. first in the Dev Console add an extra "ON/OFF" component to your device and call it something like "alert"

2. make the Action so it triggers a notification when the new "alert" component is "ON" - we are not going to be checking in the Actions what the sensor reading is but rather if the "alert" component is "ON"

3. read the comments I have included in the code below




int alert_limit = 20; // this is the 20% limit that will trigger a notification
bool alert_blocked = false; // we will use this to trigger a notification and then stop it from happening again
unsigned long last_alert_time = 0; // we will use this to track the time

void setup(){
    
    ... do what you need to do here


}

void loop(){

    int sensor_value = sensor.read(); // do some sensor reading

    if(sensor_value < alert_limit){ // we are below the allowed limit
        if(alert_blocked == false){ // if alert is not blocked then we tell ChipChop otherwise we do nothing
            ChipChop.triggerEvent("alert","ON"); //send this immediately and it will trigger the Action
            ChipChop.updateStatus("alert","OFF"); // <<< IMPORTANT: reset the alert component straight away so it doesn't trigger the notification on the next heartbeat
            alert_blocked = true; // prevent future alerts
            last_alert_time = millis(); // start a timer
        }

    }

    // if we have blocked the alert, check when 1 hour has passed and reset it so we can send alerts again
    if(alert_blocked == true){
        if(millis() - last_alert_time >= 3600000)){ // when 1 hour is passed, allow new alerts
            alert_blocked = false; // unblock the alerts        
        }
    }

    
    

}




It's a little bit more complicated if you need to dynamically change the 20% limit through the Action, what I mean is if today you use less than 20% but tomorrow you change your mind and want the notification to be triggered when it's below 30%
It can be done in many ways and normally I would use LittleFS to save on the device the 20% limit as a settings value in the flash memory and then remotely update the value if I want and read it from flash every time the device restarts.

Let me know if you need this option and I will make you some more code but you would have to use the Code Builder in the Dev Console to generate the initial code template (it's easier for ESP32 using the Code Builder and the Prefs Manager plugin)


I have increased the notifications limit on your account so you don't run out whilst you are experimenting :-)

I hope this helps and let me know if you manage to get it working

Gizmo
haruto
30 Dec 2025

Thank you very much. I got the results I wanted.
I apologize if I put too much strain on ChipChop during the experiment.

I've made some slight improvements to the code you taught me, and have pasted it below.

The component type is "Numeric Value" or "Percentage Value." The ACTION VALUE is less than 20.

This means that when a notification is received, the sensor values ​​are also sent.




    int sensor_value = soil_sensor2; // do some sensor
    if(sensor_value < alert_limit){ // we are below the allowed limit
        if(alert_blocked == false){ // if alert is not blocked then we tell ChipChop otherwise we do nothing
            ChipChop.triggerEvent("alert",soil_sensor2); //send this immediately and it will trigger the Action
            ChipChop.updateStatus("alert","NOT_DETECTED"); // <<< IMPORTANT: reset the alert component straight away so it doesn't trigger the notification on the next heartbeat
            alert_blocked = true; // prevent future alerts
            last_alert_time = millis(); // start a timer
        }

    }




I have one more question about using ChipChop, and I'm asking it before I commit any illegal activity.

Is it possible to give my login credentials for the ChipChop web app to multiple trusted people and let them use it to monitor sensors?

(I would never allow them to use it for programming; if they want to program, I'll let them create an account.)

Also, if ChipChop sends notifications to three smartphones, will it reduce the remaining notification permissions on my account by one? Or three?

Please advise me as I don't want to unknowingly commit a violation.
Gizmo
30 Dec 2025

Hi Haruto,

That's great that you have found a solution, and don't worry, you are not taking too much time or resources.. I will increase your notifications level more but let me know if you run out of notifications. Sending notifications to multiple devices at the same time does use around 30% more requests but it's not a problem.

Giving other people access to your ChipChop account is possible, I haven't documented that feature yet as it is new and there is no interface at the moment to activate it but I can set it up manually.
The way it works is by having an additional "guest" user password assigned to your login email so someone else like friends, family, colleagues can login into the ChipChop App using your email and the guest password. The guests can not login into the Dev Console and make any changes to the devices, they can only access the app.

I am about to launch a completely new ChipChop Dev Console and App with much more functionality, just need to finish the video tutorials and in the new Dev Console you will be able later to change the guest password yuurself

If you want me to set up the guest access for you can you please send me an email with a password you would like to use for the guests (if you don't have my email, let me know and I will send you one so you can just reply)
haruto
30 Dec 2025

Hi Gizmo.

Thank you for your reply. All of my questions and concerns have been addressed.

I may need guest access around February of next year, so I'll contact you then. Thank you in advance.

I'm also grateful for the notification limit. I was surprised because I didn't expect you to go to that extent.