<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://freemwiki.com/index.php?action=history&amp;feed=atom&amp;title=Openai%2F69220c71-1b68-800c-9d67-d90d67ec7eb1</id>
	<title>Openai/69220c71-1b68-800c-9d67-d90d67ec7eb1 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://freemwiki.com/index.php?action=history&amp;feed=atom&amp;title=Openai%2F69220c71-1b68-800c-9d67-d90d67ec7eb1"/>
	<link rel="alternate" type="text/html" href="https://freemwiki.com/index.php?title=Openai/69220c71-1b68-800c-9d67-d90d67ec7eb1&amp;action=history"/>
	<updated>2026-05-06T00:42:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://freemwiki.com/index.php?title=Openai/69220c71-1b68-800c-9d67-d90d67ec7eb1&amp;diff=594217&amp;oldid=prev</id>
		<title>Lukegao: by freem.ai...</title>
		<link rel="alternate" type="text/html" href="https://freemwiki.com/index.php?title=Openai/69220c71-1b68-800c-9d67-d90d67ec7eb1&amp;diff=594217&amp;oldid=prev"/>
		<updated>2025-12-09T05:22:35Z</updated>

		<summary type="html">&lt;p&gt;by freem.ai...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
{{DISPLAYTITLE:Home Assistant sauna script}}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;This conversation was exported from ChatGPT&amp;#039;&amp;#039;&amp;lt;ref&amp;gt;{{cite web|title=Home Assistant sauna script|url=https://chatgpt.com/share/69220c71-1b68-800c-9d67-d90d67ec7eb1|publisher=ChatGPT|access-date=2025-12-08}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== gpt-5-1-thinking ==&lt;br /&gt;
=== User: I have setup home assistant on my RasberryPi server, I have built a Sauna and using Sonos Amp, AC Infinity Fan with the… ===&lt;br /&gt;
I have setup home assistant on my RasberryPi server, I have built a Sauna and using Sonos Amp, AC Infinity Fan with their AI Controller, and Saunum 15 L fan. &lt;br /&gt;
&lt;br /&gt;
I have setup Sonos, ÀC Infinity Fan and Saunum (ModBus) and can see all in Home Assistant. &lt;br /&gt;
&lt;br /&gt;
Can you create a script for me for HomeAssiatnt that runs for 4 hours:&lt;br /&gt;
&lt;br /&gt;
1) start Sauna and use 1st Profile I have, run for 4 hours (warm up, use Sauna for 2 hours if we like, 1 hour warm down)&lt;br /&gt;
&lt;br /&gt;
2) Start fan at level 3 for 1st hour. During hour 2&amp;amp;3 if Co2 level goes above 400, fan speed 4, above 500 fan speed 5, above 600 fan speed 6 above 700 fan speed 7, above 900 fan speed 9. last hour of 4 hour run, run fan speed at 3&lt;br /&gt;
&lt;br /&gt;
3) During hours 2&amp;amp;3, play Spotify playlist &amp;quot;Sauna Vibes&amp;quot;, on Sonos Amp called &amp;quot;Sauna&amp;quot;. Play the playlist in random mode. Set Volume at 25. Stop playing music during last hour&lt;br /&gt;
&lt;br /&gt;
Want this to run what I say &amp;quot;hey Google, start sauna&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Assistant: Nice, this is exactly the kind of automation Home Assistant is great at. ===&lt;br /&gt;
Nice, this is exactly the kind of automation Home Assistant is great at. Below is a single script you can drop into configuration.yaml (under script:) or paste into the Scripts UI → Edit in YAML.&lt;br /&gt;
&lt;br /&gt;
You’ll just need to adjust the entity IDs and the Spotify playlist ID to match your setup.&lt;br /&gt;
&lt;br /&gt;
==== 1. Home Assistant script (4-hour sauna session) ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;yaml&amp;quot;&amp;gt;script:&lt;br /&gt;
  sauna_4_hour_session:&lt;br /&gt;
    alias: &amp;quot;Start Sauna (4-hour session)&amp;quot;&lt;br /&gt;
    mode: restart&lt;br /&gt;
    sequence:&lt;br /&gt;
      # --- Start Saunum heater on Profile 1 and run fan at 3 for first hour ---&lt;br /&gt;
* alias: &amp;quot;Start Saunum heater on Profile 1&amp;quot;&lt;br /&gt;
        # CHANGE THIS to whatever actually starts your Saunum profile 1.&lt;br /&gt;
        # Example if you have a select for profiles:&lt;br /&gt;
        service: select.select_option&lt;br /&gt;
        target:&lt;br /&gt;
          entity_id: select.saunum_profile&lt;br /&gt;
        data:&lt;br /&gt;
          option: &amp;quot;Profile 1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # If you also need to explicitly turn the heater on, add something like:&lt;br /&gt;
      # - service: switch.turn_on&lt;br /&gt;
      #   target:&lt;br /&gt;
      #     entity_id: switch.sauna_heater&lt;br /&gt;
* alias: &amp;quot;Set fan speed to 3 for warm-up hour&amp;quot;&lt;br /&gt;
        # CHANGE this entity_id to your AC Infinity fan speed control&lt;br /&gt;
        service: number.set_value&lt;br /&gt;
        target:&lt;br /&gt;
          entity_id: number.sauna_fan_speed&lt;br /&gt;
        data:&lt;br /&gt;
          value: 3&lt;br /&gt;
* alias: &amp;quot;Warm-up hour (1 hour delay)&amp;quot;&lt;br /&gt;
        delay: &amp;quot;01:00:00&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # --- Hours 2 &amp;amp; 3: music on + dynamic fan control by CO₂ ---&lt;br /&gt;
* alias: &amp;quot;Start Sauna Vibes playlist on Sonos&amp;quot;&lt;br /&gt;
        # Shuffle ON first&lt;br /&gt;
        service: media_player.shuffle_set&lt;br /&gt;
        target:&lt;br /&gt;
          entity_id: media_player.sauna   # CHANGE to your Sonos Amp entity&lt;br /&gt;
        data:&lt;br /&gt;
          shuffle: true&lt;br /&gt;
* alias: &amp;quot;Set Sonos volume to 25%&amp;quot;&lt;br /&gt;
        service: media_player.volume_set&lt;br /&gt;
        target:&lt;br /&gt;
          entity_id: media_player.sauna&lt;br /&gt;
        data:&lt;br /&gt;
          volume_level: 0.25              # 0.0–1.0&lt;br /&gt;
* alias: &amp;quot;Play Sauna Vibes playlist&amp;quot;&lt;br /&gt;
        # CHANGE media_content_id to your actual Spotify playlist URI or name&lt;br /&gt;
        service: media_player.play_media&lt;br /&gt;
        target:&lt;br /&gt;
          entity_id: media_player.sauna&lt;br /&gt;
        data:&lt;br /&gt;
          media_content_id: &amp;quot;spotify:playlist:YOUR_SAUNA_VIBES_PLAYLIST_ID&amp;quot;&lt;br /&gt;
          media_content_type: &amp;quot;playlist&amp;quot;&lt;br /&gt;
* alias: &amp;quot;Dynamic fan control for 2 hours based on CO₂&amp;quot;&lt;br /&gt;
        repeat:&lt;br /&gt;
          sequence:&lt;br /&gt;
* alias: &amp;quot;Read CO₂ level&amp;quot;&lt;br /&gt;
              variables:&lt;br /&gt;
                co2: &amp;quot;{{ states(&amp;#039;sensor.sauna_co2&amp;#039;) | int(0) }}&amp;quot;  # CHANGE entity if needed&lt;br /&gt;
* alias: &amp;quot;Set fan speed based on CO₂&amp;quot;&lt;br /&gt;
              choose:&lt;br /&gt;
* conditions: &amp;quot;{{ co2 &amp;gt; 900 }}&amp;quot;&lt;br /&gt;
                  sequence:&lt;br /&gt;
* service: number.set_value&lt;br /&gt;
                      target:&lt;br /&gt;
                        entity_id: number.sauna_fan_speed&lt;br /&gt;
                      data:&lt;br /&gt;
                        value: 9&lt;br /&gt;
* conditions: &amp;quot;{{ co2 &amp;gt; 700 }}&amp;quot;&lt;br /&gt;
                  sequence:&lt;br /&gt;
* service: number.set_value&lt;br /&gt;
                      target:&lt;br /&gt;
                        entity_id: number.sauna_fan_speed&lt;br /&gt;
                      data:&lt;br /&gt;
                        value: 7&lt;br /&gt;
* conditions: &amp;quot;{{ co2 &amp;gt; 600 }}&amp;quot;&lt;br /&gt;
                  sequence:&lt;br /&gt;
* service: number.set_value&lt;br /&gt;
                      target:&lt;br /&gt;
                        entity_id: number.sauna_fan_speed&lt;br /&gt;
                      data:&lt;br /&gt;
                        value: 6&lt;br /&gt;
* conditions: &amp;quot;{{ co2 &amp;gt; 500 }}&amp;quot;&lt;br /&gt;
                  sequence:&lt;br /&gt;
* service: number.set_value&lt;br /&gt;
                      target:&lt;br /&gt;
                        entity_id: number.sauna_fan_speed&lt;br /&gt;
                      data:&lt;br /&gt;
                        value: 5&lt;br /&gt;
* conditions: &amp;quot;{{ co2 &amp;gt; 400 }}&amp;quot;&lt;br /&gt;
                  sequence:&lt;br /&gt;
* service: number.set_value&lt;br /&gt;
                      target:&lt;br /&gt;
                        entity_id: number.sauna_fan_speed&lt;br /&gt;
                      data:&lt;br /&gt;
                        value: 4&lt;br /&gt;
              default:&lt;br /&gt;
* service: number.set_value&lt;br /&gt;
                  target:&lt;br /&gt;
                    entity_id: number.sauna_fan_speed&lt;br /&gt;
                  data:&lt;br /&gt;
                    value: 3&lt;br /&gt;
* alias: &amp;quot;Wait 1 minute before checking CO₂ again&amp;quot;&lt;br /&gt;
              delay: &amp;quot;00:01:00&amp;quot;&lt;br /&gt;
&lt;br /&gt;
          # 2 hours ≈ 120 minutes → 120 loops of 1 minute&lt;br /&gt;
          until:&lt;br /&gt;
* condition: template&lt;br /&gt;
              value_template: &amp;quot;{{ repeat.index &amp;gt;= 120 }}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # --- Hour 4: cool-down, fan at 3, no music ---&lt;br /&gt;
* alias: &amp;quot;Stop music for cool-down hour&amp;quot;&lt;br /&gt;
        service: media_player.media_stop&lt;br /&gt;
        target:&lt;br /&gt;
          entity_id: media_player.sauna&lt;br /&gt;
* alias: &amp;quot;Set fan to 3 for final cool-down hour&amp;quot;&lt;br /&gt;
        service: number.set_value&lt;br /&gt;
        target:&lt;br /&gt;
          entity_id: number.sauna_fan_speed&lt;br /&gt;
        data:&lt;br /&gt;
          value: 3&lt;br /&gt;
* alias: &amp;quot;Cool-down hour (final hour)&amp;quot;&lt;br /&gt;
        delay: &amp;quot;01:00:00&amp;quot;&lt;br /&gt;
&lt;br /&gt;
      # --- End of 4 hours: stop everything ---&lt;br /&gt;
* alias: &amp;quot;Turn off Saunum heater&amp;quot;&lt;br /&gt;
        # CHANGE to your actual off service (switch, climate, etc.)&lt;br /&gt;
        service: switch.turn_off&lt;br /&gt;
        target:&lt;br /&gt;
          entity_id: switch.sauna_heater&lt;br /&gt;
* alias: &amp;quot;Turn off fan at end of session&amp;quot;&lt;br /&gt;
        # If fan can be turned off (0), do that; otherwise you can leave at 3.&lt;br /&gt;
        service: number.set_value&lt;br /&gt;
        target:&lt;br /&gt;
          entity_id: number.sauna_fan_speed&lt;br /&gt;
        data:&lt;br /&gt;
          value: 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Things you’ll need to customize =====&lt;br /&gt;
* select.saunum_profile → your actual Saunum entity (or the service that starts Profile 1).&lt;br /&gt;
* switch.sauna_heater → your heater on/off entity (if needed).&lt;br /&gt;
* number.sauna_fan_speed → your AC Infinity fan speed entity (could be number.xxx, select.xxx, or a custom service).&lt;br /&gt;
* sensor.sauna_co2 → the actual CO₂ sensor entity in Home Assistant.&lt;br /&gt;
* media_player.sauna → your Sonos Amp entity.&lt;br /&gt;
* spotify:playlist:YOUR_SAUNA_VIBES_PLAYLIST_ID → real Spotify playlist URI for “Sauna Vibes”.&lt;br /&gt;
&lt;br /&gt;
If the fan uses a select instead of number, the service lines become:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;yaml&amp;quot;&amp;gt;service: select.select_option&lt;br /&gt;
data:&lt;br /&gt;
  option: &amp;quot;3&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
instead of number.set_value.&lt;br /&gt;
&lt;br /&gt;
==== 2. Triggering this with “Hey Google, start sauna” ====&lt;br /&gt;
&lt;br /&gt;
Once the script is in HA and reloaded:&lt;br /&gt;
# In Home Assistant, go to Settings → Automations &amp;amp; Scenes → Scripts and confirm you see “Start Sauna (4-hour session)” (script.sauna_4_hour_session).&lt;br /&gt;
# Make sure it’s exposed to Google: - If you’re using Nabu Casa / Home Assistant Cloud: Settings → Voice Assistants → Google Assistant → Exposed Entities and enable the script. - If you’re using your own Google Assistant integration, expose the script the same way you do for lights/switches.&lt;br /&gt;
# In the Google Home app, create a Routine: - Trigger phrase: start sauna - Action: “Run script sauna_4_hour_session” (it should show up as a Home Assistant script once exposed).&lt;br /&gt;
&lt;br /&gt;
After that, saying:&lt;br /&gt;
&lt;br /&gt;
: “Hey Google, start sauna”&lt;br /&gt;
&lt;br /&gt;
will kick off the whole 4-hour sequence: Saunum profile 1, fan logic by CO₂, music in hour 2–3, then cool-down with fan only.&lt;br /&gt;
&lt;br /&gt;
If you send me your actual entity IDs (or a screenshot of the Saunum, fan, and Sonos entities), I can tweak this to be copy-paste perfect for your exact setup.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:ChatGPT Shares]]&lt;br /&gt;
[[Category:openai]]&lt;/div&gt;</summary>
		<author><name>Lukegao</name></author>
	</entry>
</feed>