We are under construction!
You may experience downtime, errors or visual oddities, but we anticipate all will be resolved by the end of the day.
You may experience downtime, errors or visual oddities, but we anticipate all will be resolved by the end of the day.
Hi there!
If you are reading this post it probably means that you are a coffee addict. Or a OneStream addict. Or both!
Before starting the explanation on how to make coffee with OneStream, I would like to say I had the idea of making this while reading the OneStream Foundation Handbook – I recommend this book, it is fun to read and they are lots of good stuff in it! For example, page 21 where Greg Bankston (GregB) said “I have joked on numerous occasions that OneStream can probably even automate a customer’s coffee maker for them if they can find one that accepts the right commands. While it is indeed a joke, it is not too far from the truth either.”
To make coffee with OneStream you will need to
For the 2 first steps, after buying your Philips Hue System you should read this blog : https://developers.meethue.com/develop/get-started-2/#turning-a-light-on-and-off
The idea here is to generate a remote username.
Now you should test the api connection using a powershell script like the one below. When it is working then you should save this script on your OneStream server. You can notice that the power plug connected to the Philips Hue is seen as a light as it has only an On/Off state.
# Hue Bridge
$hueBridge = "http://192.168.109.10:80/api"
# Username
$username = '4HNMsqH9n5NwMH9n5NFVLY9n5NzZrml-45e'
# Command to Turn on
$apicontent= '{"on":true}'
# Command to Turn off – activate it on another script
# $apicontent= '{"on":false}'
# Invoke commands
Invoke-WebRequest -Method put -Uri "$($hueBridge)/$($username)/lights/21/state" -Body $apicontent
As the script is sitting on your server, I would recommend that you run it with powershell directly on the server. It is a good way to test and check that all firewall ports are open.
Once you have the powershell script running it should already turn on your coffee from the server. Do not forget to add the script to turn it off too.
Now you need to go to your OneStream application to create a Extender business rules. It should call for the powershell script on your server. It will look like this :
Namespace OneStream.BusinessRule.Extender.PlugOn
Public Class MainClass
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As ExtenderArgs) As Object
Try
' Process.Start("powershell", "-File C:\TurnOnHue")
Shell("powershell -ExecutionPolicy Bypass ""C:\TurnOnPlug"" ")
Return Nothing
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
End Class
End Namespace
Now you need to create a Data Management job that will kick your Extender BR.
And last but not least you end up with your Dashboard!
Blogs from Experts on OneStream
Next challenge : "OK Google, consolidate entity Houston" 🙂
Maybe that is a Splash presentation :). I planned to report my Smart Home analytics in OneStream using BI Viewer and then dropped the plan.
We have a customer that built a voice command UI to kick off consols. it was really just part of a hackathon amonst their developers, but yes this is possible.Great post by the way,
Now that is creative. I will get rid of Google home and start using DM jobs for lights and TV. That way, my kids will not switch on lights in the middle of the night and switch on the TV.
Let's hope for a decent mobile interface.
NicolasArgente wrote:Hi there!
If you are reading this post it probably means that you are a coffee addict. Or a OneStream addict. Or both!
Before starting the explanation on how to make coffee with OneStream, I would like to say I had the idea of making this while reading the OneStream Foundation Handbook – I recommend this book, it is fun to read and they are lots of good stuff in it! For example, page 21 where Greg Bankston (GregB) said “I have joked on numerous occasions that OneStream can probably even automate a customer’s coffee maker for them if they can find one that accepts the right commands. While it is indeed a joke, it is not too far from the truth either.”To make coffee with OneStream you will need to
- Buy a Philips hue system and connect your coffee machine to it.
- Connect the api of the Philips Hue to OS
- Create a powershell script
- Open some firewall ports
- Create a DM job that links the dashboard with the BR
- Create a BR that launches a script
- Create a dashboard – just because life is nicer with a dashboard!
For the 2 first steps, after buying your Philips Hue System you should read this blog : https://developers.meethue.com/develop/get-started-2/#turning-a-light-on-and-off
The idea here is to generate a remote username.
Now you should test the api connection using a powershell script like the one below. When it is working then you should save this script on your OneStream server. You can notice that the power plug connected to the Philips Hue is seen as a light as it has only an On/Off state.
# Hue Bridge
$hueBridge = "http://192.168.109.10:80/api"
# Username
$username = '4HNMsqH9n5NwMH9n5NFVLY9n5NzZrml-45e'
# Command to Turn on
$apicontent= '{"on":true}'
# Command to Turn off – activate it on another script
# $apicontent= '{"on":false}'
# Invoke commands
Invoke-WebRequest -Method put -Uri "$($hueBridge)/$($username)/lights/21/state" -Body $apicontent
As the script is sitting on your server, I would recommend that you run it with powershell directly on the server. It is a good way to test and check that all firewall ports are open.
Once you have the powershell script running it should already turn on your coffee from the server. Do not forget to add the script to turn it off too.
Now you need to go to your OneStream application to create a Extender business rules. It should call for the powershell script on your server. It will look like this :
Namespace OneStream.BusinessRule.Extender.PlugOn
Public Class MainClass
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As ExtenderArgs) As Object
Try
' Process.Start("powershell", "-File C:\TurnOnHue")
Shell("powershell -ExecutionPolicy Bypass ""C:\TurnOnPlug")
Return Nothing
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
End Class
End Namespace
Now you need to create a Data Management job that will kick your Extender BR.
And last but not least you end up with your Dashboard!
Nice one Nic, presume it can also work with a smart plug converter that uses IFTTT. Love your creativity
I always joke it could make julienned fries (from Aladdin ... https://getyarn.io/yarn-clip/484013e5-1195-48e1-ab13-53a565eaea41) Do you have a solution for that? 😀
Funny..., I did not know about those julienned fries. 😀 Thanks Kathryn
Love it!
This is awesome 😄
The possibilities are endless !!
Great job Nic
This is amazing. How often have I told a client that OneStream could make coffee if you tried. Love this.
Hi vvalentine thanks for your comment! Now you can keep on saying you can make Coffee with OS 🙂