Smart meter interaction - help please

Hi

So here is my query with what I want to do.

I'm developing a module to do with energy.

I have a number of items on scree e.g. TV, computer, kettle, fridge/freezer, etc. the usual consumer/electrical items you would expect to find in a UK house. Each item will have a value, e.g. TV=10, Fridge/Freezer=20, Kettle=5, Computer=15, etc.

The screen will also show a smart electricity meter.

I want the learner to be able to click (select) any of the items, so when they click the TV (10), the smart electricity meter shows 10. When they select the Kettle (5) the meter changes to 15; when they deselect the TV (10) the meter changes to 5, etc. What this is in theory doing is showing how the cost or energy consumption goes up ior down depending on what items have been turned on (selected) or turned off (de-selected).

The smart meter will be a graphic that has a window for the numbers which I guess would be a text variable - basically this is a + or - type of calculation for each item.

Any ideas how I would achieve this please?

Cheers!

Nick

9 Replies
Alexandros Anoyatis

Hi Nick,

It should be a number variable, not a text one. Basically, you need triggers to add/subtract a certain number to that number var, if the state is normal or selected. For example "adjust value of variable x to + 5 if state of kettle==selected" and so on and so forth.

There are a couple of ways to do this (with or without layers) but it is ultimately a matter of preference.

Hope this helps,
Alex

Michael Hinze

See attached a quick example of how this might be done. I use the selected states of the four "appliances" (in my example these are buttons, they could be images) to change the stateĀ of a meter object. This object has custom states that indicate the usage, e.g. the Usage5 state is shown if the state of the kettle button I Selected. Hope that gets you started.