question

Mark avatar image
Mark asked

relay switch on mage page tiles on raspberry pi

HI

Has anyone added relay switches to the tiles on the main pages? I've managed to add a switch to the tile but I cant select/switch it? I added this to the tile

Tile {

width: 160

height: bottomRow.height

editable: true

readOnly: false

color: "#538ed7"

border.width: 2

border.color: "#fff"


MbSwitch {

id: manualSwitch1

name: qsTr("L/L")

bind: "com.victronenergy.system/Relay/1/State"

show: hasRelay1



}

I'm guessing ive missed a comand or something? when i added the MbSwitch to pagemain.qml it works ok. I'd just like to be able to switch the relays from one of the main tiles rather than having to open menu.

Hope this makes sense

Thanks Mark

Venus OSRaspberry PiRelay
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

3 Answers
chompy avatar image
chompy answered ·

Hi Mark,


Did you ever get this to work? I want to add 4 relay switches to the main page and have just started using the Venus OS on Raspberry Pi


Thanks,


Matt

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Mark avatar image
Mark answered ·

Hi Matt

No i didn't Im afraid I gave up as I kept white screen crashing grrr

Cheers

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Kevin Windrem avatar image Kevin Windrem commented ·

BTW, you can usually determine what's causing the white screen by examining the GUI log file: /var/log/gui/current. You can at least determine where the error is occurring (file name and line number).

0 Likes 0 ·
Mark avatar image Mark Kevin Windrem commented ·

Winner thank you

0 Likes 0 ·
Kevin Windrem avatar image
Kevin Windrem answered ·

It looks like the switches on the pages screens are handled differently than on the setup menus. Look at code on OverviewMobile.qml. There are three buttons at the bottom of that screen. There is code to handle the display (e.g., acModeButton tile) but also to handle button ("Keys") and mouse clicks.

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Mark avatar image Mark commented ·

Cheers mate ill have a look and If I get anywhere ill post on here what and how I did it

0 Likes 0 ·
Mark avatar image Mark commented ·

Hi Kevin

Did you manage to get it working?

Thanks mark

0 Likes 0 ·

Related Resources

Additional resources still need to be added for this topic

Raspberry Pi running Victron’s Venus firmware - Blog Post

Venus OS Large image: Signal K and Node-RED - Install

raspberrypi install venus image


Victron Venus OS Open Source intro page

Venus OS GitHub (please do not post to this)

Additional resources still need to be added for this topic