Hi, I have no idea if its normal or how to prevent it, when i start/restart pimatic, it switches on and off all relays in the board, I was wondering how can I prevent this behaviour? any idea? thanks in advance. PH
-
Arduino Relays Board on/off on start or restart pimatic
-
Try to add default state to the gpios in the pimatic config.
"defaultState ": true
-
@p4co86 ok, I´ll try, this will work for arduino? I mean I am using HOMEDUINO plugin… thanks
-
Did you solve the problem, @hp?
I’m having the same problem with relays and homeduino -
default state works for me by using the gpio`s on the pi.
-
@flybysun no, not yet, surely someone has the anwser!
-
@p4co86 I´ll try it
-
someone any clues???
-
how can i add a switch to change the state of the gpio from the arduino. i will buy a mega, it has 54 digita I/O. i need more than the 22 gpios on the raspbarry, is it possible to use the gpios from the arduino mega?
If so, how does the config thing looks like?
thanks
-
A gpio switch looks like this in the config.
{ "id": "pin-switch", "name": "Pin Switch", "class": "HomeduinoSwitch", "inverted": false, "pin": 4 }
pimatic rocks!!!
-
nice thanks, maybe someone could actualize the homeduino plugin, copuldnt find it there. thanks
-
https://github.com/pimatic/pimatic-homeduino#pin-switch-example
It is already in the readme.pimatic rocks!!!
-
now i see it. is it possible to use arduino mega. i need the gpios.
-
@p4co86
should be possible, but you’ll have to edit the makefile and use the correct board tag first, then flash homeduino
have a look here, but i guess you already know about the most of it
Howto Homeduino flashingpimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !
-
ok thanks, have ordered one clone. yes i know the most of it. thanks
-
just a little notification. it works with the arduino mega 2560 clone. thanks.
-
@p4co86 @hp do you have solved the issue with Relays Board on/off on start or restrt pimatic? I have the same issue. Currently I’m using GPIO class with the defaultState parameter which works - but I have to use homeduinoSwitch, because I need Raspis GPIO pin’s for another project - defaultState for homeduinoSwitch isn’t available - please help.
-
i use the gpio from the raspberry. i have added this:
"defaultState ": true
to my gpio.
but i didn`t try it with the gpios from homeduino.
-
I’ve tried this with homeduino, but that didn’t work.
In my opinion this happens when Pimatic is started and the homeduino-plugin is initialized. So I guess inside the plugin there must be a default state. If you look at the Switch code constructor section of the coffee script file for homeduino then you find this:class HomeduinoSwitch extends env.devices.PowerSwitch constructor: (@config, lastState, @board) -> @id = config.id @name = config.name @_state = lastState?.state?.value or off hdPlugin.pendingConnect.then( => return @board.pinMode(@config.pin, Board.OUTPUT) ).then( => return @_writeState(@_state) ).catch( (error) => env.logger.error error env.logger.debug error.stack ) super()
maybe changing this line
@_state = lastState?.state?.value or off
to this
@_state = lastState?.state?.value or on
does the job?
Is it possible to just change the code inside the node module? I havent tried it, but will do it once I’m back at home. The only problem would be that once the plugin gets an update the issue will be there again.
-
Is it possible to enhance the homeduinoSwitch with the defaultState Parameter so that this will be available also with updates?