Code Check: Fuel Piston


#1

So I want to graph all events from my door lock.
Do I have the logic right?


#2

BumP!

TIA! :smiley:


#3

Actually it does not work… lol :stuck_out_tongue:

Any ideas? :slight_smile:


#4

As you learned you can not use a string in the fuel stream. Instead just use numbers. 1s and 0s.


#5

So I have to create a variable that said’s for locked 0 and for unlocked 1?


#6

IF door changes to open
Then
Write to fuel stream (new fuel stream) value 1
End if
IF door changes to closed
Then
Write to fuel stream (new fuel stream) value 0
End if

Just make sure you don’t send this data to the old one. It is corrupted with the strings in there. There is no way to delete fuel stream data or any of the canisters yet.


#7

Thanks!


#8

Really would love a way to delete a fuel stream… any chance of getting that added in any time soon?


#9

I don’t have a time frame of when this might get looked into but I believe it was not towards the top of the list unfortunately.


#10

My thought for a very minimal change to make this possible for users to hack around is to add CSS classes to the fuel streams page corresponding to the canister and stream names. So if I wanted to hide my “Barn multisensor” canister I could use Stylish or some other user stylesheet to hide it with .canister-barn-multisensor { display: none } or hide the Temperature stream with .canister-barn-multisensor .fuel-stream-temperature { display: none }

Obviously not ideal but very easy. With a bit more work you could set up a UI to collapse or hide a stream and persist that to a cookie (streams have numeric IDs). Either way, hidden but not deleted – but I think most people just want to hide streams they no longer need to avoid the clutter. A minor concern with making it easy to hide streams is that data can still be written to them and users may not remember to remove the code from a piston that pumps data to the stream.


#11

@ipaterson, I am very interested in seeing a working example of your code in Stylish. I have tried it verbatim to the example above, but no results. There is so many layers of CSS required to display the Fuel Stream page, I am actually having difficulty finding my canister names among the code, so I simply converted spaces to “-” and Capitalized to lowercase, as in your example. Would you be able to send a screen shot of your Stylish code please? This is my failed attempt:

trash


#12

By inspecting the element, this is the code I find:

trash

The top line, selects the whole canister, and the 2nd line only selects the title of the canister. I am a bit perplexed as to why there is no unique name or label in the “li.ng-scope” line. How would I go about hiding that entire canister? This example doesn’t look right:
.li.ng-scope.house-v3 { display: none !important; }

I admit, my CSS knowledge has slipped a bit with lack of use. Any guidance would be greatly appreciated. I really need to tidy up the left column in my Fuel Streams after all my extensive testing during the learning process. Thanks!


#13

My earlier comment was suggesting the addition of a unique name that could be used for that kind of CSS selector but it doesn’t exist yet.


#14

Whew, this one was a doozie. I have finally figured out how to hide extraneous canisters in fuel streams, but I have a couple caveats.

  1. It only hides the data points, not the title of the canister
  2. It does not stop data from being written to the data point
  3. If you add another canister in the future, you may have to edit this code since the order may shift

So before you try this, please make sure that no piston is writing to any data points within the canister. This should ONLY be done on canisters that are empty and useless (to help clear up the clutter)

Here is the code for Stylish that I am using that hides the canisters #1, #2 and #4:

trash

I might work on clearing the titles later, but this solves 95% of my issue with clutter, so I am happy for now. Hopefully it helps someone else as well.

Let me know if you have any trouble @ipaterson


Fuel stream management
#15

Here is a little picture showing two of my hidden canisters. (House v3 & Temp)
The titles are still visible, but 15 of my old data points are hidden at this time…
It’s a bit convoluted of a solution :pretzel: but it’s much more tidy looking now…

trash

If anyone takes the time to crack the code to remove the titles as well, please share with us…


#16

Here is my temporary solution to hide the titles of the canisters: