[APP] Boolean Toolbox - Create advanced logic with simple formulas

Boolean Toolbox v1.5.0 is now available in the Homey App Store!

Replace complex flow networks with powerful logic devices controlled by dynamic formulas. Make your flows cleaner, more readable, and easier to maintain.


What’s New in v1.5.0

:hourglass_not_done: Waiter Gates (BETA)

Reactive flow cards that pause and wait for device states to change:

  • Wait until device capability becomes value (with YES/NO paths)
  • Perfect for verifying that commands actually executed
  • Auto-generated waiter IDs for easy management

→ Read Waiter Gates Documentation

:globe_showing_europe_africa: Complete Localization

All flow cards now support 12 languages: English, Norwegian, Danish, German, Spanish, French, Italian, Dutch, Swedish, Polish, Finnish, Russian

:wrench: Code Quality Improvements

Reduced logging verbosity and improved code documentation


Device Types

Logic Device - Recommended for beginners

  • Visual pairing wizard with zone/room selection
  • Single formula per device
  • State changed trigger

Logic Unit - For advanced users

  • Multiple formulas per device
  • Full JSON configuration
  • Dynamic input expansion (2-10 inputs)

Logic Unit X - Deprecated

  • Fixed input counts (2, 3, 4…10)
  • Still functional but not recommended for new setups

→ Complete Device Guide


Documentation


Installation and Links


Feedback & Support

Found a bug or have a suggestion? Please report it:

  • GitHub Issues: Report here
  • This Forum Thread: Reply below!

All feedback is greatly appreciated and helps shape the future of this app.


Support the Project

If you find Boolean Toolbox useful, consider supporting its development:

PayPal


Boolean Toolbox - Simplify complex logic in your Homey flows :high_voltage:

1 Like

[placeholder]

going to follow this! great idea. Had for myself already built out the various logic gates and how to do that in flows, but would applaud doing that easier:

Yeah, that’s why I started this project. I was sick and tired of having to think boolean in new ways. And starting out in electronics, not being able to deal with boolean logic was a bummer.

Would love to find a better action card for it, but this is making it one heck of a lot easier to create logic. And I finally have an output that will be false if the logic didn’t stick.

Please tell me if you test it with some fancy formulas. I still haven’t had time to be really creative with it yet. But I will - because now I can :wink:

I need to try this. I need to find a scenario where this would fit :thinking::grin:

F(A,B,C,D,E)=(((A∗!B)⊕(C∗B))+(D∗(A⊕E)))⊕((C+E)∗(!D+B))

Returns TRUE for the following, with all five inputs used :slight_smile:

| A | B | C | D | E |
| FALSE | FALSE | FALSE | FALSE | TRUE |
| FALSE | FALSE | FALSE | TRUE | TRUE |
| FALSE | FALSE | TRUE | FALSE | FALSE |
| FALSE | FALSE | TRUE | FALSE | TRUE |
| FALSE | FALSE | TRUE | TRUE | TRUE |
| FALSE | TRUE | FALSE | FALSE | TRUE |
| TRUE | FALSE | FALSE | FALSE | FALSE |
| TRUE | FALSE | FALSE | TRUE | FALSE |
| TRUE | FALSE | FALSE | TRUE | TRUE |
| TRUE | FALSE | TRUE | TRUE | FALSE |
| TRUE | FALSE | TRUE | TRUE | TRUE |
| TRUE | TRUE | FALSE | FALSE | TRUE |
| TRUE | TRUE | FALSE | TRUE | FALSE |
| TRUE | TRUE | FALSE | TRUE | TRUE |

why not use + for and and / for or? would be a bit more logical and readable

and what is the circle with the plus sign in it, and the !?

Usually, in electronics we use + for OR, for AND, ! for NOT and the plus in the circle for XOR. It makes sense as AND is a more powerful “addition” than OR - * is more powerful than + :slight_smile:

To make it easier to type, I’ve stuck with the +, * and ! that I’m used to. For XOR, I “created” a new easy to access sign with “^”.

EDIT: If people want to, I can probably make aliases where AND could be either & or *, OR could be | or +, and XOR could be ^ or !=

1 Like

I discovered two things the other day - my code was incomprehensible, and it didn’t work. I did a complete rehaul and pretty much made the whole thing from scratch again. The good thing now is that it works, and it’s better than the original :slight_smile:

I’ve made some more major changes and launched v1. Should be plenty of reasons to try this one instead of the 0.7 launched earlier today :slight_smile:

I’ve made an update to the version on Github and would love some feedback! I’ve added a logic device, so you can make a virtual device made up of any (I hope…) device type and capability. For most people, this should be more user friendly than the logic unit (although not as flexible).

Want to create a device that will be active when a door is open, there’s a water leak and the backyard camera is not active? Sure! Go ahead!

:rocket: New Feature: State Device (Snapshot & Restore)

I’m excited to announce a major new feature currently available in the test version of Boolean Toolbox: The State Device.

:link: Test Link: https://homey.app/en-no/app/no.tiwas.booleantoolbox/Boolean-Toolbox/test/

What is it?

The State Device allows you to take a “snapshot” of the current state of your devices (lights, blinds, thermostats, etc.) in specific zones (rooms) or your whole house. You can then restore this state later using a simple Flow card.

Think of it as creating your own complex Scenes on the fly, without having to manually add every single card to a Flow.

How to use it

  1. Add a new Device: Go to Devices+Boolean ToolboxState Device.
  2. Select Scope: Choose which Zones (Rooms) you want to capture. You can select “Whole House” or pick specific rooms like “Living Room” and “Kitchen”.
  3. Select Devices: You will see a list of all compatible devices found in those zones. Uncheck any devices you don’t want to include in the snapshot.
  4. Edit Configuration (Optional): You will see the generated JSON configuration. This contains the exact values captured (e.g., dim: 0.8, onoff: true). You can edit this manually if you want to fine-tune values or remove specific capabilities.
  5. Done!

Editing an existing State Device

You are not locked into the initial snapshot forever. If you want to add a new lamp, remove an old one, or tweak the brightness level:

  1. Open the State Device in the Homey app.
  2. Go to Settings (gear icon) → Advanced Settings.
  3. Look for the Configuration (JSON) field.
  4. Here you can manually edit the list. You can delete blocks for devices you want to remove, or adjust values (e.g., change "dim": 0.5 to "dim": 0.8).
  5. Click Save.

Restoring the State

Once the device is created, simply use the “Apply state” action card in any Flow to restore all the captured devices to their saved settings.


:warning: Important “Gotchas” & Tips

1. The “Dim turns it back on” trap

When capturing a state, the app saves all setable capabilities.
If a light is currently OFF but has a dim level of 50% (0.5) in memory, the snapshot might look like this:

"My Light": {
  "onoff": false,
  "dim": 0.5
}

When restoring this state, Homey sends commands sequentially. If it sends onoff: false (Light turns off) and then dim: 0.5, many Zigbee/Z-Wave bulbs will turn back ON to 50% brightness automatically because they received a dim command.

Solution: If you want a light to stay OFF in your scene, you should manually edit the JSON during the pairing wizard (Step 3) and remove the "dim" line for that device, leaving only "onoff": false.

2. Delays and Network Traffic

Restoring a state for 50 devices at once can flood your Zigbee/Z-Wave network.

  • The State Device has a built-in default delay (default 200ms) between each command to help with this.
  • You can edit the default_delay in the JSON configuration (in Advanced Settings of the device) if you need it to go slower.

3. Missing Devices

If you remove a physical device from Homey that is part of a State Device snapshot, the State Device will log an error when you try to run it.

  • You can enable “Ignore Errors” in the JSON config ("ignore_errors": true) to make it skip missing devices silently.
  • You can also enable Debug Mode in the App Settings to see exactly which device is failing.

Feedback

This is a powerful tool, but it’s complex under the hood. Please let me know if you encounter any issues or have suggestions for improvements!

Happy automating! :hammer_and_wrench:

Hi,

I wondered if you weren’t aware of this app? Or did you still like to build similar functionality yourself anyway?

Thanks. I’m aware of it, but I liked my way of doing it better. It might have gone a long way since I tested it, but I think mine makes it a lot easier (at least than it used to be) to configure and change the scenes.

I’d love some feedback, though :slight_smile:

1 Like

Ah wow! The states section is indeed a lot more user friendly, and not needing flows is a big plus.

So I played a bit with it.
It’s great we can edit the created JSON, but i can imagine it’s not for everyone. Maybe it’s possible to call the checklist again in edit mode, for changing devices

Nice to have:

  • Is it possible to add a capability (un)check list prior or following the zone checklist?
    This would be nice when I want to create lights-only scenes for example.

Findings / remarks:

  • When selecting a zone, devices in the subzone are listed in the selection list of the next screen.
    But the subzones were deselected.

  • The activated tiles are switched off after a minute. I’d prefer the tile to stay on (but I can imagine others don’t). Additionally there will be a tag with the state available for use in flows.

Issue:

  • (My) RGBW lights are in white mode, temperature as capability. When saving it’s state, sometimes somehow it was in color mode
    When recalling the state, the lights turn into some color, like blue;
    I recall the dev of Zone Memory having troubles with this similar issue as well.
    → When I manually replace “color” by “temperature” in the JSON, and remove the saturation and hue capabilities, changing states goes well.

Just an idea: have the user select if color mode is used? Or the other way round

Thanks for the kind words and for great feedback.

Yeah, it’s probably more on the advanced side of things. I’ve been thinking about making a web page for my repo that will make it easier. But I had to choose beween keeping it really simple or really powerful. Those don’t always go hand-in-hand. Ask the maintainers of vi :stuck_out_tongue:

I’ve been thinking about making it a little more user-friendly, though. Adding an optional delay for every level (global, zone, room, device) that will override or add to the global delay. I’ve also been thinking about grouping the devices in the json on a room basis to make it easier to get a good overview. As I’m using the devices’ id, changing the numbers of levels in the json (I’ll just flatten it internally) shouldn’t break anything.

As for getting the checklist again, I had that on my todo, too, but couldn’t find a good way to do it. It’s no harder than just creating a new device, checking the devices you want, copy the json and cancel the creation. The other option is to make a web tool, but it seems to be a limit to the number of API hits (100, more than most people will need).

Any thoughts? Making tools here and there will make it harder to maintain, so if the “almost create a new device to get a fresh json” is good enough, I might stick with that for the time being.

Could you explain this a little better? I’m not sure I understood. You have three levels (Home → Zone → Subzone), you deselct Home and Subzone so that only Zone is selected and you still get devices from Subzone?

I’m very curious if you have a good solution for me here, because this was on my list. This is a solid idea, but I thought it might be a problem if you use them for “moods”. Like if you wanted to activate “Kitchen: romantic”, “Living room: pitch black” AND “Alarm sensors: Active, except cat door” so that you could mix and match.

How about I add a selection (default: true) to turn off the other devices (but take no action, just “turn off” the device card), so if you activate a new scene using three devices you’d turn off others when starting the flow, then activate the rest with the option set to false?

Did it read the wrong capabilities? Or were you thinking more that when selecting devices you could select capability instead? Say a device has dim, on/off, hue, saturation - you want to select only dim and saturation, and move saturation to the top?

Ok, I’ve worked on this further. Would you mind testing the new version?

There are some docs here: State Device - Boolean Toolbox for Homey

I’ll see if I can make some sort of editor without using the Homey-API, but first I’d appreciate it if you could see if this fixes your problems :slight_smile:

No problem!

Throw in the “I know what I’m doing” button :rofl:

No, it was a misunderstanding from my side because of the zones I selected.
After some new tests I noticed there’s nothing wrong with it :face_with_hand_over_mouth:

That sounds like a plan.

+1

I had the screens of the < group > app in mind;
it has an edit screen, which is, to the user, the same screen as the initial selection screen; it uses the Maintenance > Try to repair route
This is the edit screen:

Hmmm…so what you’re after is to be able to re-do the selection process? I guess this is doable, but I’m not sure how to do it and not change any of the settings.

Would you want a new snapshot, a new snapshot for any new devices, or to reselect from the old snapshot? The last one would require that I save every single device state in the json, and only make a new snapshot for new devices.

I guess I can create an option in the pairing dialog to save all devices and use a key to say it’s active or not. The json could be REALLY big for some installations, though. And if I were to save all devices to the json object, should I just include the ones in the selected zones or all devices in all zones?

I could make a web app that would let people edit the json object they already have, and getting a fresh object should be fairly easy by creating a new device and then just copy the json to the old one.

If you have any ideas I will see if I can do it in the app, or if it’s better done in a standalone json editor just for this app. I guess I could also create a function to import a new json, but only include new objects?

How about something like this? This should give a lot more value, and be very helpful to inexperienced users.

Well, that’ll do, Lars!