Read the statement by Michael Teeuw here.
MMM-Pir toggling
-
Is it possible to set the relay toggling not only when switching on or off, but during both state changes. So a toggle when switching off and a toggle when switching on.
The background is that I want to use the relay to operate my standby button on the monitor.
The relay currently switches off after a set time and switches on again when there is movement. This switches the supply voltage completely. It would be better to leave the power supply permanently connected and only switch the stanby button. But for this you need a change in the state of the relay with every process.
I couldn’t get it to work in the settings. where can you change the behavior of the relay? mode 6 and mod 7 at the same time so to speak. -
@ttt126 said in MMM-Pir toggling:
config: {
triggers:[
{
trigger: “USER_PRESENCE”,
fires: [
{
exec: (payload) => {
return "python3 /homr/pi/neu1.py " + payload.option
}
},
],
},
]
}The pathon3 comand was missing. I´m not quite firm with programming.
But a serce for executing a py script brought the answere! -
@ttt126 best to ask the author
-
How can i do so?
Is he actice on this forum? -
@ttt126 generally youwould open an issue on the module githib page
@bugsounet can you please add an issues tab to the module? so we can keep track of things like this without you having to troll the forum too…
-
Thanks for your answer. I don’t want to troll anything here.
On Github I can make a pull request under mmm-pir. I think that’s not the point. I can’t find a new issue there.
So here are my questions. -
@ttt126 troll wasn’t indended for you. he is a busy guy. PIR is busted all over the place with bookworm.
-
Thanks, opened an issue here:
https://github.com/KristjanESPERANTO/MagicMirror-3rd-Party-Modules/issues
Will see
-
Hi,
MMM-Pir v2 is under coding
Unfortunately, it is not possible to use mode 6 and 7 at the same time (same GPIO)This module send
USER_PRESENCE
notification withtrue
orfalse
payload (it’s the screen state)
You can trigger it with this module MMM-NotificationTrigger and exec a personal script for thisNote:
- python
RPi.GPIO
will be deleted (in next release) because there is a compatibility problem with pi5 and with bookworm too. - I will try to recode it with
gpiod
library for both compatibility
- python
-
Would it be possible to create a mode in which a relay is switched when detected on the PIR and after the new timer has expired.
So an on off toggle, so to speak. This would make it possible to switch any monitor using the Stanfby button. HDMI on/off would then not be necessary, simply a relay on the monitor button and all monitors could be used.
Unfortunately, I’m not that good at cascading the module.
Thank you for your great work -
Thank you very much, I spent the whole day trying to understand notification triggers and producing a config, unfortunately without success.
Maybe you can help me out. how do I do the config so that the trigger can be taken over by mmmpir? I’ve already created a small py script with a gpio pin that goes on and off, it’s in the root directory.
But I just can’t get the execut function to be implemented.{
module: “MMM-NotificationTrigger”,
config: {
triggers:[
{
trigger: “USER_PRESENCE”,
fires: [
{
exec: “/neu1.py”
}
],
},
]
}
},